统一项目角色展示与预设文案
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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)");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user