mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2026-01-25 07:23:28 +01:00
refactor: remove pocketbase (#1138)
This commit is contained in:
28
app/settings/settings_test.go
Normal file
28
app/settings/settings_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package settings_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/SecurityBrewery/catalyst/app/data"
|
||||
"github.com/SecurityBrewery/catalyst/app/settings"
|
||||
)
|
||||
|
||||
func TestUpdateSettings(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
queries := data.NewTestDB(t, t.TempDir())
|
||||
|
||||
_, err := settings.Update(t.Context(), queries, func(settings *settings.Settings) {
|
||||
settings.Meta.AppName = "UpdatedApp"
|
||||
settings.Meta.AppURL = "https://example.com"
|
||||
})
|
||||
require.NoError(t, err, "Save should not return an error")
|
||||
|
||||
got, err := settings.Load(t.Context(), queries)
|
||||
require.NoError(t, err, "Load should not return an error")
|
||||
|
||||
require.Equal(t, "UpdatedApp", got.Meta.AppName, "AppName should match after saving and loading settings")
|
||||
require.Equal(t, "https://example.com", got.Meta.AppURL, "AppURL should match after saving and loading settings")
|
||||
}
|
||||
Reference in New Issue
Block a user