Skip to content

Commit

Permalink
♻️ [#36] Fix the progress indicator overview/confirmation step state
Browse files Browse the repository at this point in the history
The overview should be navigable once all the preceding steps are
completed, rather than always rendering a placeholder.
  • Loading branch information
sergei-maertens committed Nov 29, 2023
1 parent 246f90b commit 1dbd964
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,15 @@ const AppointmentProgress = ({title, currentStep}) => {
isCompleted: isConfirmation,
isApplicable: true,
isCurrent: checkMatchesPath(currentPathname, 'overzicht'),
canNavigateTo: false,
canNavigateTo: steps.every(step => step.isCompleted),
},
{
to: 'bevestiging',
label: intl.formatMessage(STEP_LABELS.confirmation),
isCompleted: isSubmissionComplete,
isApplicable: true,
isCurrent: checkMatchesPath(currentPathname, 'bevestiging'),
canNavigateTo: isSubmissionComplete,
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,13 @@ export const HappyFlow = {
/I accept the privacy policy and consent to the processing of my personal data/
)
);

// test that the progress indicator displays all the expected links
await canvas.findByRole('link', {name: 'Product'});
await canvas.findByRole('link', {name: 'Afspraakdetails'});
await canvas.findByRole('link', {name: 'Contactgegevens'});
await canvas.findByRole('link', {name: 'Overzicht'});

const submitButton = canvas.getByRole('button', {name: 'Confirm'});
await waitFor(async () => {
expect(submitButton).not.toHaveAttribute('aria-disabled', 'true');
Expand All @@ -233,6 +240,7 @@ export const HappyFlow = {
},
{timeout: 2000, interval: 200}
);
await canvas.findByRole('link', {name: 'Bevestiging'});
});
},
};

0 comments on commit 1dbd964

Please sign in to comment.