优化桌面端标签导航与后台交互
Client Quality Gates / Shared client and Web (push) Has been cancelled
Client Quality Gates / macOS Desktop (push) Has been cancelled

This commit is contained in:
Cheng Zhou
2026-07-09 08:56:13 +08:00
parent 76f2d9f22a
commit 0aff10fe0d
17 changed files with 1232 additions and 207 deletions
+15
View File
@@ -94,6 +94,21 @@ describe("admin project route permissions", () => {
expect(source).toContain('if (token && !studyStore.currentStudy && !isDesktopRuntime)');
});
it("canonicalizes the legacy file version entry before rendering its loading fallback", () => {
const source = readRouter();
const guardIndex = source.indexOf('if (to.name === "FileVersionManagement" && studyStore.currentStudy?.id)');
const requiresStudyIndex = source.indexOf("if (to.meta.requiresStudy && !studyStore.currentStudy)");
const legacyRouteIndex = source.indexOf('name: "FileVersionManagement"');
const legacyRouteEnd = source.indexOf('path: "trial/:trialId/documents"', legacyRouteIndex);
const legacyRoute = source.slice(legacyRouteIndex, legacyRouteEnd);
expect(guardIndex).toBeGreaterThan(-1);
expect(requiresStudyIndex).toBeGreaterThan(guardIndex);
expect(legacyRoute).toContain("component: DocumentList");
expect(source).not.toContain('import FileVersionManagement from "../views/ia/FileVersionManagement.vue";');
expect(source).toContain('next({ name: "DocumentList", params: { trialId: studyStore.currentStudy.id }, replace: true });');
});
it("validates restored session tokens through /me before entering protected routes", () => {
const source = readRouter();
const restoreGuardIndex = source.indexOf("if (!auth.user && getToken() && !isDesktopSessionRestoreRoute)");