diff --git a/plugins/lighthouse/src/components/AuditView/index.test.tsx b/plugins/lighthouse/src/components/AuditView/index.test.tsx index c68daddc67..d19543d679 100644 --- a/plugins/lighthouse/src/components/AuditView/index.test.tsx +++ b/plugins/lighthouse/src/components/AuditView/index.test.tsx @@ -149,6 +149,28 @@ describe('AuditView', () => { ).toHaveAttribute('href', `/audit/${a.id}`); }); }); + + it('navigates to the next report with respect to the base path', async () => { + // TODO: I would need help here. How to set the base path for the test? + const basePath = `/lighthouse`; + const rendered = render( + wrapInTestApp( + + + , + { routeEntries: [basePath] }, + ), + ); + + await rendered.findByTestId('audit-sidebar'); + + websiteResponse.audits.forEach(a => { + expect( + rendered.getByText(formatTime(a.timeCreated)).parentElement + ?.parentElement, + ).toHaveAttribute('href', `${basePath}/audits/${a.id}`); + }); + }); }); describe('when the request for the website by id is pending', () => { diff --git a/plugins/lighthouse/src/components/AuditView/index.tsx b/plugins/lighthouse/src/components/AuditView/index.tsx index e377894c90..52a087fd8e 100644 --- a/plugins/lighthouse/src/components/AuditView/index.tsx +++ b/plugins/lighthouse/src/components/AuditView/index.tsx @@ -80,7 +80,7 @@ const AuditLinkList = ({ audits = [], selectedId }: AuditLinkListProps) => ( button component={Link} replace - to={resolvePath(generatePath('audit/:id', { id: audit.id }), '../../')} + to={resolvePath(generatePath('audit/:id', { id: audit.id }), '../')} > @@ -178,7 +178,7 @@ export const AuditViewContent = () => {