website/pkg/config/admin_scopes_test.go
2024-11-28 12:31:04 -08:00

22 lines
622 B
Go

package config_test
import (
"testing"
"code.nonshy.com/nonshy/website/pkg/config"
)
// TestAdminScopesCount validates that all named admin scopes are
// returned by the scope list function.
func TestAdminScopesCount(t *testing.T) {
var scopes = config.ListAdminScopes()
if len(scopes) != config.QuantityAdminScopes || len(scopes) != len(config.AdminScopeDescriptions)-1 {
t.Errorf(
"The list of scopes returned by ListAdminScopes doesn't match the expected count. "+
"Expected %d (with %d descriptions), got %d",
config.QuantityAdminScopes, len(config.AdminScopeDescriptions),
len(scopes),
)
}
}