mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update workspace setting service
This commit is contained in:
@ -7,6 +7,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
apiv1 "github.com/usememos/memos/api/v1"
|
||||
storepb "github.com/usememos/memos/proto/gen/store"
|
||||
"github.com/usememos/memos/store"
|
||||
)
|
||||
|
||||
@ -38,3 +39,22 @@ func TestWorkspaceSettingStore(t *testing.T) {
|
||||
require.Equal(t, 4, len(list))
|
||||
ts.Close()
|
||||
}
|
||||
|
||||
func TestWorkspaceSettingV1Store(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ts := NewTestingStore(ctx, t)
|
||||
workspaceSetting, err := ts.UpsertWorkspaceSettingV1(ctx, &storepb.WorkspaceSetting{
|
||||
Key: storepb.WorkspaceSettingKey_WORKSPACE_SETTING_GENERAL,
|
||||
Value: &storepb.WorkspaceSetting_General{
|
||||
General: &storepb.WorkspaceGeneralSetting{
|
||||
DisallowSignup: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
require.NoError(t, err)
|
||||
list, err := ts.ListWorkspaceSettingsV1(ctx, &store.FindWorkspaceSettingV1{})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 1, len(list))
|
||||
require.Equal(t, workspaceSetting, list[0])
|
||||
ts.Close()
|
||||
}
|
||||
|
Reference in New Issue
Block a user