package store

import (
	"reflect"
	"testing"
)

func TestNormalizeAPIKeyScopes(t *testing.T) {
	got := normalizeAPIKeyScopes([]string{" Chat ", "AUDIO", "", "chat", "*", "all", " text_to_speech "})
	want := []string{"chat", "audio", "all", "text_to_speech"}
	if !reflect.DeepEqual(got, want) {
		t.Fatalf("normalize scopes = %#v, want %#v", got, want)
	}
}
