navidrome/server/apiv1/dto_test.go
Deluan 45d8a7724d test(api): share API v1 test helpers and check scopes in Go
Move the end-to-end call/setup/mint helpers to a suite-level test client
and the apiauth login/mustMint helpers to package level. Replace the
hardcoded vacuum x-scope enum with a Go test that every known scope is
a valid spec Scope; the gate already rejects unknown x-scope values.
2026-09-28 20:06:28 -04:00

15 lines
426 B
Go

package apiv1
import (
"github.com/navidrome/navidrome/core/apiauth"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
)
var _ = Describe("toScopes", func() {
It("only produces scopes the spec's Scope enum allows", func() {
for _, s := range toScopes(append([]string{apiauth.ScopeAll}, apiauth.KnownScopes...)) {
Expect(s.Valid()).To(BeTrue(), "scope %q is missing from the spec's Scope enum", s)
}
})
})