mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 06:05:24 +00:00
Moves docker backend and frontend into plugins/docker/, alongside ssh-terminal. Adds a host editor tab seam, a dashboard card registry, and a build step to compile plugin backends into dist.
37 lines
922 B
TypeScript
37 lines
922 B
TypeScript
import { afterEach, describe, expect, it } from "vitest";
|
|
import {
|
|
registerDashboardCard,
|
|
registeredDashboardCardList,
|
|
unregisterDashboardCard,
|
|
} from "@/dashboard/dashboard-cards-registry";
|
|
|
|
const FAKE_CARD_ID = "__test_plugin_dashboard_card__";
|
|
|
|
describe("registerDashboardCard seam", () => {
|
|
afterEach(() => {
|
|
unregisterDashboardCard(FAKE_CARD_ID);
|
|
});
|
|
|
|
it("is not registered by default", () => {
|
|
expect(registeredDashboardCardList()).toEqual([]);
|
|
});
|
|
|
|
it("registers and unregisters a plugin dashboard card", () => {
|
|
registerDashboardCard({
|
|
id: FAKE_CARD_ID,
|
|
titleKey: "nav.fakePluginItem",
|
|
render: () => null,
|
|
});
|
|
|
|
expect(registeredDashboardCardList().map((c) => c.id)).toContain(
|
|
FAKE_CARD_ID,
|
|
);
|
|
|
|
unregisterDashboardCard(FAKE_CARD_ID);
|
|
|
|
expect(registeredDashboardCardList().map((c) => c.id)).not.toContain(
|
|
FAKE_CARD_ID,
|
|
);
|
|
});
|
|
});
|