From c8bc964de504594232b3f45c1e16b1653c35ace4 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Wed, 21 Oct 2026 01:54:59 +0000 Subject: [PATCH] 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 --- core/http/routes/addon_navigation_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/http/routes/addon_navigation_test.go b/core/http/routes/addon_navigation_test.go index e04c11445..413a2f077 100644 --- a/core/http/routes/addon_navigation_test.go +++ b/core/http/routes/addon_navigation_test.go @@ -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())