fix: resolve final workbench review findings

This commit is contained in:
2026-07-19 20:20:09 +08:00
parent 43d0b9f049
commit 27ff659c30
12 changed files with 172 additions and 30 deletions

View File

@@ -11,7 +11,7 @@ describe('ProjectWorkbench', () => {
expect(screen.getByRole('button', { name: 'Project A1' })).toHaveAttribute('aria-pressed', 'true');
expect(screen.getByLabelText('Project channels')).toBeInTheDocument();
expect(screen.getByRole('button', { name: 'Message Flow 36' })).toBeInTheDocument();
expect(screen.getByLabelText('Global search')).toBeInTheDocument();
expect(screen.getByLabelText('Global search')).toBeDisabled();
expect(screen.getByLabelText('Object inspector')).toBeInTheDocument();
});
@@ -69,4 +69,34 @@ describe('ProjectWorkbench', () => {
await fireEvent.click(screen.getByRole('button', { name: 'Message Flow 36' }));
expect(within(inspector).getByRole('heading', { name: 'Inspector' })).toBeInTheDocument();
});
it('preserves task completion when switching channels within a project', async () => {
render(ProjectWorkbench, { props: { currentUser: { account: 'david@example.com' } } });
await fireEvent.click(screen.getByRole('button', { name: 'Work Plan 8' }));
const task = screen.getByRole('checkbox', { name: 'Mark Confirm homepage information architecture complete' });
await fireEvent.click(task);
expect(task).toBeChecked();
await fireEvent.click(screen.getByRole('button', { name: 'Message Flow 36' }));
await fireEvent.click(screen.getByRole('button', { name: 'Work Plan 8' }));
expect(screen.getByRole('checkbox', { name: 'Mark Confirm homepage information architecture complete' })).toBeChecked();
await fireEvent.click(screen.getByRole('button', { name: 'Project A2' }));
await fireEvent.click(screen.getByRole('button', { name: 'Work Plan 8' }));
expect(screen.getByRole('checkbox', { name: 'Mark Confirm homepage information architecture complete' })).not.toBeChecked();
});
it('provides Copy link feedback and disables unavailable archive actions', async () => {
render(ProjectWorkbench, { props: { currentUser: { account: 'david@example.com' } } });
const inspector = screen.getByLabelText('Object inspector');
await fireEvent.click(screen.getByRole('button', { name: 'Work Plan 8' }));
await fireEvent.click(screen.getByRole('button', { name: 'Inspect Confirm homepage information architecture' }));
await fireEvent.click(within(inspector).getByRole('button', { name: 'More' }));
await fireEvent.click(within(inspector).getByRole('button', { name: 'Copy link' }));
expect(within(inspector).getByRole('status')).toHaveTextContent('Link copied to clipboard.');
expect(within(inspector).getByRole('button', { name: 'Archive is unavailable in this preview' })).toBeDisabled();
});
});