fix(tests): initialize auth in AverageRating tests

The toArtist and toArtistID3 functions call publicurl.ImageURL which
requires auth.TokenAuth to be initialized. Without this, the tests
panic with nil pointer dereference when calling CreatePublicToken.
This commit is contained in:
Deluan 2026-01-18 21:38:54 -05:00
parent b49d18b18d
commit 2b564074b5

View File

@ -6,9 +6,11 @@ import (
"github.com/navidrome/navidrome/conf"
"github.com/navidrome/navidrome/conf/configtest"
"github.com/navidrome/navidrome/core/auth"
"github.com/navidrome/navidrome/model"
"github.com/navidrome/navidrome/model/request"
"github.com/navidrome/navidrome/server/subsonic/responses"
"github.com/navidrome/navidrome/tests"
"github.com/navidrome/navidrome/utils/req"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
@ -461,6 +463,8 @@ var _ = Describe("helpers", func() {
var ctx context.Context
BeforeEach(func() {
ds := &tests.MockDataStore{}
auth.Init(ds)
ctx = context.Background()
conf.Server.Subsonic.EnableAverageRating = true
})