mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15:24 +00:00
fix: home tab, layout switch and missing layout fallbacks for looks
This commit is contained in:
1 parent
4c235bb23f
commit
ec3cc9cf18
14 files changed
+761
-11
No files matched your search
@@ -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"]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user