mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-15 11:40:13 +00:00
tests: adapt unit test for new app config default value behavior
This commit is contained in:
@@ -47,9 +47,8 @@ func TestLoadDbConfig(t *testing.T) {
|
|||||||
// Populate the config table with some initial values
|
// Populate the config table with some initial values
|
||||||
err := db.
|
err := db.
|
||||||
Create([]model.AppConfigVariable{
|
Create([]model.AppConfigVariable{
|
||||||
// Should be set to the default value because it's an empty string
|
|
||||||
{Key: "appName", Value: ""},
|
|
||||||
// Overrides default value
|
// Overrides default value
|
||||||
|
{Key: "appName", Value: "Test App"},
|
||||||
{Key: "sessionDuration", Value: "5"},
|
{Key: "sessionDuration", Value: "5"},
|
||||||
// Does not have a default value
|
// Does not have a default value
|
||||||
{Key: "smtpHost", Value: "example"},
|
{Key: "smtpHost", Value: "example"},
|
||||||
@@ -66,6 +65,7 @@ func TestLoadDbConfig(t *testing.T) {
|
|||||||
|
|
||||||
// Values should match expected ones
|
// Values should match expected ones
|
||||||
expect := service.getDefaultDbConfig()
|
expect := service.getDefaultDbConfig()
|
||||||
|
expect.AppName.Value = "Test App"
|
||||||
expect.SessionDuration.Value = "5"
|
expect.SessionDuration.Value = "5"
|
||||||
expect.SmtpHost.Value = "example"
|
expect.SmtpHost.Value = "example"
|
||||||
require.Equal(t, service.GetDbConfig(), expect)
|
require.Equal(t, service.GetDbConfig(), expect)
|
||||||
|
|||||||
Reference in New Issue
Block a user