mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-29 07:52:50 -05:00
core: mock wayland context for tests & add i18n guidance to CONTRIBUTING
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
package dwl
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
mocks_wlclient "github.com/AvengeMedia/DankMaterialShell/core/internal/mocks/wlclient"
|
||||
)
|
||||
|
||||
func TestStateChanged_BothNil(t *testing.T) {
|
||||
@@ -350,3 +353,14 @@ func TestStateChanged_TagsLengthDiffers(t *testing.T) {
|
||||
}
|
||||
assert.True(t, stateChanged(a, b))
|
||||
}
|
||||
|
||||
func TestNewManager_GetRegistryError(t *testing.T) {
|
||||
mockDisplay := mocks_wlclient.NewMockWaylandDisplay(t)
|
||||
|
||||
mockDisplay.EXPECT().Context().Return(nil)
|
||||
mockDisplay.EXPECT().GetRegistry().Return(nil, errors.New("failed to get registry"))
|
||||
|
||||
_, err := NewManager(mockDisplay)
|
||||
assert.Error(t, err)
|
||||
assert.Contains(t, err.Error(), "failed to get registry")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user