mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15:24 +00:00
feat: move color themes into a bundled themes plugin
This commit is contained in:
1 parent
d049588f7f
commit
b414b85746
20 files changed
+305
-406
No files matched your search
@@ -99,3 +99,48 @@ describe("termix-plugin validate themes", () => {
|
||||
expect(output).not.toContain("theme paper");
|
||||
});
|
||||
});
|
||||
|
||||
describe("termix-plugin validate layouts and capabilities", () => {
|
||||
function withManifest(extra: Record<string, unknown>) {
|
||||
const root = plugin([]);
|
||||
fs.writeFileSync(
|
||||
path.join(root, "manifest.json"),
|
||||
JSON.stringify({ id: "fixture", version: "1.0.0", ...extra }),
|
||||
);
|
||||
return root;
|
||||
}
|
||||
|
||||
it("flags ui:theme with no themes and ui:layout with no layouts", async () => {
|
||||
const output = await problems(
|
||||
withManifest({ capabilities: ["ui:theme", "ui:layout"] }),
|
||||
);
|
||||
expect(output).toContain(
|
||||
'"ui:theme" is declared but contributes.themes is empty',
|
||||
);
|
||||
expect(output).toContain(
|
||||
'"ui:layout" is declared but contributes.layouts is empty',
|
||||
);
|
||||
});
|
||||
|
||||
it("flags a layout plugin with no frontend source", async () => {
|
||||
const output = await problems(
|
||||
withManifest({
|
||||
capabilities: ["ui:layout"],
|
||||
contributes: { layouts: [{ id: "wide", label: "Wide" }] },
|
||||
}),
|
||||
);
|
||||
expect(output).toContain("contributes.layouts needs a frontend");
|
||||
});
|
||||
|
||||
it("accepts a layout plugin that has a frontend entry", async () => {
|
||||
const root = withManifest({
|
||||
capabilities: ["ui:layout"],
|
||||
contributes: { layouts: [{ id: "wide", label: "Wide" }] },
|
||||
});
|
||||
fs.mkdirSync(path.join(root, "src", "frontend"), { recursive: true });
|
||||
fs.writeFileSync(path.join(root, "src", "frontend", "index.tsx"), "");
|
||||
const output = await problems(root);
|
||||
expect(output).not.toContain("contributes.layouts needs a frontend");
|
||||
expect(output).not.toContain("is declared but");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user