diff --git a/services/platform/app/routes/dashboard/$id/projects/$projectId.test.tsx b/services/platform/app/routes/dashboard/$id/projects/$projectId.test.tsx index ded189fc9c..f39fc741dd 100644 --- a/services/platform/app/routes/dashboard/$id/projects/$projectId.test.tsx +++ b/services/platform/app/routes/dashboard/$id/projects/$projectId.test.tsx @@ -280,6 +280,50 @@ describe('project shell โ€” All projects Tasks mode', () => { // An archived project said so only in the Projects list. Every one of its tabs // now carries the badge, beside the breadcrumb leaf. describe('project shell โ€” archived badge', () => { + it.each(['board', 'list'])( + 'keeps the aggregate %s unbadged when the path project is archived live or on a fresh mount', + (view) => { + mockLocation.pathname = `/dashboard/org-1/projects/proj-1/tasks/${view}`; + mockLocation.search = { projects: 'all' }; + const { rerender, unmount } = setup([]); + + expect( + screen.queryByText('projects.archived.badge'), + ).not.toBeInTheDocument(); + + mockUseProject.mockReturnValue({ + project: { _id: 'proj-1', name: 'Apollo', archivedAt: 1789000000000 }, + isLoading: false, + }); + rerender(); + expect( + screen.queryByText('projects.archived.badge'), + ).not.toBeInTheDocument(); + expect( + screen.getByRole('link', { name: 'tasks.title' }), + ).toBeInTheDocument(); + + unmount(); + setup([], { archivedAt: 1789000000000 }); + expect( + screen.queryByText('projects.archived.badge'), + ).not.toBeInTheDocument(); + expect( + screen.getByRole('link', { name: 'tasks.title' }), + ).toBeInTheDocument(); + }, + ); + + it.each(['board', 'list'])( + 'keeps the archived badge on a single-project %s', + (view) => { + mockLocation.pathname = `/dashboard/org-1/projects/proj-1/tasks/${view}`; + setup([], { archivedAt: 1789000000000 }); + + expect(screen.getByText('projects.archived.badge')).toBeInTheDocument(); + }, + ); + it('badges the breadcrumb when the project is archived', () => { setup([], { archivedAt: 1789000000000 }); diff --git a/services/platform/app/routes/dashboard/$id/projects/$projectId.tsx b/services/platform/app/routes/dashboard/$id/projects/$projectId.tsx index 9b4a03f9df..3201d6a740 100644 --- a/services/platform/app/routes/dashboard/$id/projects/$projectId.tsx +++ b/services/platform/app/routes/dashboard/$id/projects/$projectId.tsx @@ -368,9 +368,10 @@ function ProjectDetailLayout() { projectId={asProjectId(projectId)} projectName={project.name} /> - {project.archivedAt !== undefined && ( - - )} + {!allProjectsMode && + project.archivedAt !== undefined && ( + + )} ) : ( diff --git a/services/platform/tests/manual/reference/automation.md b/services/platform/tests/manual/reference/automation.md index 0835a7b969..212d1f33d9 100644 --- a/services/platform/tests/manual/reference/automation.md +++ b/services/platform/tests/manual/reference/automation.md @@ -175,6 +175,12 @@ One row per case group, carried over from the per-suite coverage tables the guides used to hold. **Don't** re-verify an automated row by hand: a red there is a spec failure and belongs in the gate, not in a round. +The All projects board and list never badge the archived project retained in +the URL. `app/routes/dashboard/$id/projects/$projectId.test.tsx` covers a live +archive update, a fresh mount with an archived path project (reload state), and +the archived badge retained on single-project board/list pages. Real-browser +reloads and cross-session archive delivery remain manual. + Legend: โœ… fully automated ยท ๐Ÿ”ถ partially automated ยท โ›” manual-only (no spec). | Suite | Boxes | Status | Owning spec |