18 lines
795 B
TypeScript
18 lines
795 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { readFileSync } from "node:fs";
|
|
import { resolve } from "node:path";
|
|
|
|
const readSource = () => readFileSync(resolve(__dirname, "./StudyHome.vue"), "utf8");
|
|
|
|
describe("StudyHome role labels", () => {
|
|
it("uses permission template names for the current project role label", () => {
|
|
const source = readSource();
|
|
|
|
expect(source).toContain("useRoleTemplateMeta");
|
|
expect(source).toContain("const { roleLabel: displayRoleLabel, loadRoleTemplates } = useRoleTemplateMeta();");
|
|
expect(source).toContain("const roleLabel = computed(() => displayRoleLabel(projectRole.value));");
|
|
expect(source).toContain("loadRoleTemplates();");
|
|
expect(source).not.toContain("displayEnum(TEXT.enums.userRole, projectRole.value)");
|
|
});
|
|
});
|