mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 22:55:24 +00:00
feat: type the plugin host record, move plugin strings out of core and add lint checks
This commit is contained in:
1 parent
bba06f7ff6
commit
b8bbcd2196
626 files changed
+23884
-4590
No files matched your search
@@ -38,6 +38,25 @@ describe(`${manifest.id} activate`, () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("reads its switches from its own host settings", async () => {
|
||||
rendered = await renderWithApp(plugin, { manifest, locales });
|
||||
const host = (settings: Record<string, unknown>) => ({
|
||||
id: "1",
|
||||
name: "pve",
|
||||
ip: "10.0.0.1",
|
||||
port: 22,
|
||||
pluginSettings: { proxmox: settings },
|
||||
});
|
||||
const ids = (settings: Record<string, unknown>) =>
|
||||
rendered!.registered.hostActionsFor(host(settings)).map((a) => a.id);
|
||||
expect(ids({ enableProxmox: true })).toContain("proxmox-discover");
|
||||
expect(ids({})).not.toContain("proxmox-discover");
|
||||
expect(ids({ enableProxmoxStats: true })).toContain("proxmox-stats");
|
||||
expect(plugin.proxmoxSettings(host({ enableProxmoxStats: true }))).toEqual({
|
||||
enableProxmoxStats: true,
|
||||
});
|
||||
});
|
||||
|
||||
it("removes everything it registered on deactivate", async () => {
|
||||
const app = await renderWithApp(plugin, { manifest, locales });
|
||||
await app.deactivate();
|
||||
|
||||
Reference in new issue
Block a user