test(server): make the handleM3U spec independent of spec order (#6221)

It relied on another spec having set auth.PublicTokenAuth, so it panicked whenever Ginkgo ran it first.
This commit is contained in:
Deluan Quintão 2026-09-24 22:07:17 -04:00 • committed by GitHub
commit 3f89baaec8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4,7 +4,9 @@ import (
"net/http"
"net/http/httptest"
"github.com/go-chi/jwtauth/v5"
"github.com/navidrome/navidrome/core"
"github.com/navidrome/navidrome/core/auth"
"github.com/navidrome/navidrome/model"
"github.com/navidrome/navidrome/tests"
. "github.com/onsi/ginkgo/v2"
@ -17,6 +19,7 @@ var _ = Describe("handleM3U", func() {
var pub *Router
BeforeEach(func() {
auth.PublicTokenAuth = jwtauth.New("HS256", []byte("test-secret"), nil)
ds = &tests.MockDataStore{}
shareRepo = &tests.MockShareRepo{}
ds.MockedShare = shareRepo