Skip to content

Commit

Permalink
adds redirect to process end and fixes tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cammiida committed Dec 4, 2024
1 parent e5b0a43 commit 2c6ba10
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/components/wrappers/ProcessWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ export const ProcessWrapper = () => {
const isValidTaskId = useIsValidTaskId();
const taskIdParam = useNavigationParam('taskId');
const taskType = useGetTaskTypeById()(taskIdParam);
const process = useLaxProcessData();

if (process?.ended) {
return <NavigateToStartUrl />;
}

if (!isValidTaskId(taskIdParam)) {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/features/receipt/ReceiptContainer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe('ReceiptContainer', () => {

expect(
screen.getByRole('heading', {
name: 'Skjema er sendt inn',
name: 'Skjemaet er sendt inn',
}),
).toBeInTheDocument();

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/integration/frontend-test/custom-confirm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ describe('Custom confirm page', () => {
cy.get('[data-componentid="confirmBody"]').should('contain.text', `på forrige side valgte du Petter.`);
cy.findByRole('button', { name: /send inn/i }).click();

cy.get('#ReceiptContainer').should('contain.text', 'Skjema er sendt inn');
cy.get('#ReceiptContainer').should('contain.text', 'Skjemaet er sendt inn');
});
});

0 comments on commit 2c6ba10

Please sign in to comment.