package security

import "testing"

func TestRecoveryCodeHashNormalizesFormatting(t *testing.T) {
	t.Parallel()

	want := RecoveryCodeHash("ABCD-EFGH-IJKL-MNOP")
	got := RecoveryCodeHash("abcd efgh ijkl mnop")
	if got != want {
		t.Fatalf("expected matching hashes for normalized recovery codes")
	}
}

func TestNormalizeScopesRejectsUnknownScopes(t *testing.T) {
	t.Parallel()

	if _, err := NormalizeScopes([]string{ScopeAdminRead, "root:everything"}); err == nil {
		t.Fatalf("expected unknown scope to be rejected")
	}
}
