mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: update store types name (#1862)
This commit is contained in:
27
test/store/user_setting_test.go
Normal file
27
test/store/user_setting_test.go
Normal file
@ -0,0 +1,27 @@
|
||||
package teststore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
"github.com/usememos/memos/store"
|
||||
)
|
||||
|
||||
func TestUserSettingStore(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
ts := NewTestingStore(ctx, t)
|
||||
user, err := createTestingHostUser(ctx, ts)
|
||||
require.NoError(t, err)
|
||||
_, err = ts.UpsertUserSetting(ctx, &store.UserSetting{
|
||||
UserID: user.ID,
|
||||
Key: "test_key",
|
||||
Value: "test_value",
|
||||
})
|
||||
require.NoError(t, err)
|
||||
list, err := ts.ListUserSettings(ctx, &store.FindUserSetting{})
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, 1, len(list))
|
||||
require.Equal(t, "test_key", list[0].Key)
|
||||
require.Equal(t, "test_value", list[0].Value)
|
||||
}
|
Reference in New Issue
Block a user