chore: update store tests (#1449)

This commit is contained in:
boojack
2023-04-03 09:53:36 +08:00
committed by GitHub
parent 4f2adfef7b
commit c9a5df81ce
5 changed files with 101 additions and 15 deletions

View File

@ -0,0 +1,35 @@
package teststore
import (
"context"
"testing"
"github.com/stretchr/testify/require"
"github.com/usememos/memos/api"
)
func TestSystemSettingStore(t *testing.T) {
ctx := context.Background()
store := NewTestingStore(ctx, t)
_, err := store.UpsertSystemSetting(ctx, &api.SystemSettingUpsert{
Name: api.SystemSettingServerIDName,
Value: "test_server_id",
})
require.NoError(t, err)
_, err = store.UpsertSystemSetting(ctx, &api.SystemSettingUpsert{
Name: api.SystemSettingSecretSessionName,
Value: "test_secret_session_name",
})
require.NoError(t, err)
_, err = store.UpsertSystemSetting(ctx, &api.SystemSettingUpsert{
Name: api.SystemSettingAllowSignUpName,
Value: "true",
})
require.NoError(t, err)
_, err = store.UpsertSystemSetting(ctx, &api.SystemSettingUpsert{
Name: api.SystemSettingLocalStoragePathName,
Value: "/tmp/memos",
})
require.NoError(t, err)
}