test(addons): give the navigation routes spec its own catalog

No page is built in today, so the catalog is empty and the three specs
that expect the studio and talk entries failed on the list and on the
pin seed. They passed only while Studio and Talk were built in.

The spec now sets a catalog of two ungated entries for each example and
restores the old one afterwards. The assertions are unchanged.

Assisted-by: Claude Code:claude-sonnet-5-5 go
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto committed 2026-10-21 01:54:59 +00:00
1 parent 48634619c1
commit c8bc964de5
1 file changed
+7
@@ -17,6 +17,7 @@ import (
"github.com/mudler/LocalAI/core/config"
"github.com/mudler/LocalAI/core/http/auth"
"github.com/mudler/LocalAI/core/http/routes"
"github.com/mudler/LocalAI/core/services/addons/builtin"
"github.com/mudler/LocalAI/pkg/addons/contract"
"github.com/mudler/LocalAI/pkg/system"
. "github.com/onsi/ginkgo/v2"
@@ -33,6 +34,12 @@ var _ = Describe("Add-on navigation routes with real authentication", func() {
token string
)
BeforeEach(func() {
// No page is built in today, so the specs make up two ungated entries to
// check the list, the pin seed and the pin filter against.
DeferCleanup(builtin.SetCatalogForTest([]builtin.Entry{
{ID: "studio", Kind: builtin.KindPage, TitleKey: "studio", Icon: "fa-wand-magic-sparkles", MainPath: "/app/studio"},
{ID: "talk", Kind: builtin.KindPage, TitleKey: "talk", Icon: "fa-microphone", MainPath: "/app/talk"},
}))
dir := GinkgoT().TempDir()
models, backends := filepath.Join(dir, "models"), filepath.Join(dir, "backends")
Expect(os.Mkdir(models, 0750)).To(Succeed())