fix: home tab, layout switch and missing layout fallbacks for looks

This commit is contained in:
LukeGus committed 2026-10-18 19:08:50 -05:00
1 parent 4c235bb23f
commit ec3cc9cf18
14 files changed
+761 -11

No files matched your search

+16
View File
@@ -6,6 +6,7 @@ vi.mock("../../plugins/bundled-index.js", () => ({
}));
import {
installedLayoutIds,
resolveDefaultLook,
safeLayoutForced,
unavailableLooks,
@@ -23,6 +24,10 @@ function loaderWith(
plugins[id]
? ({ manifest: { contributes: plugins[id] } } as never)
: undefined,
list: () =>
Object.values(plugins).map(
(contributes) => ({ manifest: { contributes } }) as never,
),
skipped: () => skipped,
};
}
@@ -103,3 +108,14 @@ describe("safeLayoutForced", () => {
expect(safeLayoutForced()).toBe(false);
});
});
describe("installedLayoutIds", () => {
it("lists layouts of loaded and skipped plugins", () => {
const ids = installedLayoutIds(
loaderWith({ a: { layouts: [{ id: "one" }], themes: [{ id: "t" }] } }, [
{ id: "b", version: null, layouts: ["two"], themes: [], error: "x" },
]),
);
expect([...ids].sort()).toEqual(["one", "two"]);
});
});