mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-13 21:58:42 +01:00
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.
15 lines
426 B
Go
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)
|
|
}
|
|
})
|
|
})
|