Fix setup keys

This commit is contained in:
braginini
2024-04-17 19:48:09 +02:00
parent 41d4dd2aff
commit e6628ec231
2 changed files with 19 additions and 1 deletions

View File

@@ -107,6 +107,9 @@ func TestSqlite_SaveAccount_Large(t *testing.T) {
SearchDomainsEnabled: false,
}
account.NameServerGroups[nameserver.ID] = nameserver
setupKey := GenerateDefaultSetupKey()
account.SetupKeys[setupKey.Id] = setupKey
}
err = store.SaveAccount(account)
@@ -153,6 +156,18 @@ func TestSqlite_SaveAccount_Large(t *testing.T) {
numPerAccount, len(a.NameServerGroups))
return
}
if a != nil && len(a.NameServerGroups) != numPerAccount {
t.Errorf("expecting Account to have %d NameServerGroups stored after SaveAccount(), got %d",
numPerAccount, len(a.NameServerGroups))
return
}
if a != nil && len(a.SetupKeys) != numPerAccount+1 {
t.Errorf("expecting Account to have %d SetupKeys stored after SaveAccount(), got %d",
numPerAccount+1, len(a.SetupKeys))
return
}
}
func TestSqlite_SaveAccount(t *testing.T) {