mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
feat: shell controller, TabStage, layout and theme plugins with repair view
This commit is contained in:
1 parent
aff29a9581
commit
86161d66e2
120 files changed
+23693
-3381
No files matched your search
@@ -416,3 +416,71 @@ describe("rebuilding local plugins", () => {
|
||||
expect(run.sort()).toEqual(["a", "b"]);
|
||||
});
|
||||
});
|
||||
|
||||
describe("default look", () => {
|
||||
const entry = { source: "tmxplug", path: "a", sha256: SHA };
|
||||
|
||||
it("reads the defaultLook flag and refuses anything but a boolean", () => {
|
||||
const { plugins, problems } = parseBundledPlugins({
|
||||
plugins: [
|
||||
{ ...entry, id: "look", defaultLook: true },
|
||||
{ ...entry, id: "plain" },
|
||||
{ ...entry, id: "odd", defaultLook: "yes" },
|
||||
],
|
||||
});
|
||||
expect(problems).toEqual(["odd defaultLook must be a boolean"]);
|
||||
expect(
|
||||
plugins.map((p: { id: string; defaultLook: boolean }) => [
|
||||
p.id,
|
||||
p.defaultLook,
|
||||
]),
|
||||
).toEqual([
|
||||
["look", true],
|
||||
["plain", false],
|
||||
]);
|
||||
});
|
||||
|
||||
it("carries it into the bundled index and through a re-pin", () => {
|
||||
expect(
|
||||
buildBundledIndex(
|
||||
[
|
||||
{ id: "look", onboarding: null, defaultLook: true },
|
||||
{ id: "plain", onboarding: null, defaultLook: false },
|
||||
],
|
||||
["look", "plain"],
|
||||
),
|
||||
).toEqual({ version: 1, plugins: { look: { defaultLook: true } } });
|
||||
|
||||
const index = {
|
||||
plugins: [
|
||||
{
|
||||
id: "look",
|
||||
versions: [
|
||||
{ version: "1.0.0", url: "https://x/l.tmxplug", sha256: SHA },
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
expect(
|
||||
pinsFromIndex(index, null, [{ id: "look", defaultLook: true }])[0],
|
||||
).toMatchObject({ id: "look", defaultLook: true });
|
||||
});
|
||||
|
||||
it("copies a local build's theme files", () => {
|
||||
const repo = tempDir();
|
||||
fs.mkdirSync(path.join(repo, "dist"), { recursive: true });
|
||||
fs.mkdirSync(path.join(repo, "themes"), { recursive: true });
|
||||
fs.writeFileSync(path.join(repo, "dist", "backend.js"), "export {}");
|
||||
fs.writeFileSync(path.join(repo, "themes", "paper.css"), ".paper{}");
|
||||
fs.writeFileSync(
|
||||
path.join(repo, "manifest.json"),
|
||||
JSON.stringify({
|
||||
id: "inks",
|
||||
contributes: { themes: [{ id: "paper", css: "themes/paper.css" }] },
|
||||
}),
|
||||
);
|
||||
const out = path.join(tempDir(), "inks");
|
||||
copyLocalBuild(repo, out);
|
||||
expect(fs.existsSync(path.join(out, "themes", "paper.css"))).toBe(true);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user