整理测试代码并清理文档引用

This commit is contained in:
Cheng Zhou
2026-06-22 17:27:11 +08:00
parent 6056c8364a
commit c351ca59c4
75 changed files with 15 additions and 4415 deletions
@@ -1,21 +0,0 @@
import { describe, expect, it } from "vitest";
import { readFileSync } from "node:fs";
import { resolve } from "node:path";
const readSource = () => readFileSync(resolve(__dirname, "./DocumentList.vue"), "utf8");
describe("DocumentList project permissions", () => {
it("hides document create/update/delete controls and guards direct mutation calls by backend permissions", () => {
const source = readSource();
expect(source).toContain('v-if="canCreate"');
expect(source).toContain('v-if="canUpdate"');
expect(source).toContain('v-if="canDelete"');
expect(source).toContain("if (!canCreate.value)");
expect(source).toContain("if (!canUpdate.value)");
expect(source).toContain("if (!canDelete.value)");
expect(source).toContain("if (isInactiveSite(row.site_id))");
expect(source).toContain('@click.stop="openEdit(row)"');
expect(source).not.toContain(':disabled="!canCreate"');
});
});