import { readFileSync } from "node:fs"; import { join } from "node:path"; import { describe, expect, it } from "vitest"; const source = readFileSync( join(process.cwd(), "src/views/dashboards/superUserDashboard/department/modules/DepartmentModulesSetup.vue"), "utf8" ); describe("DepartmentModulesSetup self-serve management regression", () => { it("loads and updates department self-serve status through shared helpers", () => { expect(source).toContain("getDepartmentSelfServeEnabled"); expect(source).toContain("setDepartmentSelfServeEnabled"); expect(source).toContain("loadSelfServeEnabled()"); expect(source).toContain("updateSelfServeEnabled"); }); it("renders a dedicated self-serve module switch in setup UI", () => { expect(source).toContain('subtitle="Selvvask"'); expect(source).toContain('title="Selvvask"'); expect(source).toContain("Aktiver selvvask i denne afdeling."); }); });