优化桌面端标签导航与后台交互
This commit is contained in:
@@ -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)");
|
||||
|
||||
Reference in New Issue
Block a user