mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 14:45:24 +00:00
feat: move the classic layout into its own bundled plugin
This commit is contained in:
1 parent
86161d66e2
commit
d049588f7f
234 files changed
+3066
-76205
No files matched your search
@@ -169,6 +169,7 @@ const manageMock = vi.hoisted(() => ({
|
||||
updatePlugin: vi.fn(),
|
||||
updateAllPlugins: vi.fn(),
|
||||
uninstallPlugin: vi.fn(),
|
||||
restoreBundledPlugin: vi.fn(),
|
||||
setPluginOptions: vi.fn(),
|
||||
setAllPluginChannels: vi.fn(),
|
||||
getPluginDataSummary: vi.fn(),
|
||||
@@ -1141,6 +1142,35 @@ describe("plugins route", () => {
|
||||
expect(manageMock.uninstallPlugin).toHaveBeenCalledWith("docker");
|
||||
});
|
||||
|
||||
it("restores the bundled copy", async () => {
|
||||
manageMock.restoreBundledPlugin.mockResolvedValue({
|
||||
id: "docker",
|
||||
version: "1.0.0",
|
||||
state: "active",
|
||||
});
|
||||
const res = await post("/plugins/docker/restore-bundled");
|
||||
expect(res.status).toBe(200);
|
||||
expect(await res.json()).toEqual({
|
||||
id: "docker",
|
||||
version: "1.0.0",
|
||||
state: "active",
|
||||
});
|
||||
expect(manageMock.restoreBundledPlugin).toHaveBeenCalledWith("docker");
|
||||
});
|
||||
|
||||
it("answers 409 when a plugin has no bundled copy", async () => {
|
||||
manageMock.restoreBundledPlugin.mockRejectedValue(
|
||||
new PluginManageError(
|
||||
"This plugin has no bundled copy",
|
||||
409,
|
||||
"NO_BUNDLED_COPY",
|
||||
),
|
||||
);
|
||||
const res = await post("/plugins/docker/restore-bundled");
|
||||
expect(res.status).toBe(409);
|
||||
expect((await res.json()).code).toBe("NO_BUNDLED_COPY");
|
||||
});
|
||||
|
||||
it("refuses changes on a linked desktop", async () => {
|
||||
manageMock.isLinkedDesktop.mockResolvedValue(true);
|
||||
const res = await post("/plugins/docker/install");
|
||||
|
||||
Reference in new issue
Block a user