Skip to content

Commit

Permalink
♻️ [#462] Update stories
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm committed Oct 23, 2023
1 parent 7ac7b53 commit 4986347
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/components/Summary/Summary.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,14 @@ export const MultipleRequiredStatements = {
const submitButton = canvas.getByRole('button', {name: 'Confirm'});
expect(submitButton).toHaveAttribute('aria-disabled', 'true');

const submitButtonWrapper = submitButton.parentElement;
expect(submitButtonWrapper.classList).toContain(
'openforms-disabled-clickable-button__clickable-wrap'
);

// Clicking 'submit' without checking the statements results in all the warnings being
// displayed
await userEvent.click(submitButton);
await userEvent.click(submitButtonWrapper);
expect(
await canvas.findByText('U moet akkoord gaan met het privacybeleid om door te gaan')
).toBeVisible();
Expand Down Expand Up @@ -243,7 +248,9 @@ export const MultipleRequiredStatements = {
expect(
canvas.queryByText('U moet akkoord gaan met het privacybeleid om door te gaan')
).toBeNull();
expect(submitButton).not.toHaveAttribute('aria-disabled', 'true');

const updatedSubmitButton = canvas.getByRole('button', {name: 'Confirm'});
expect(updatedSubmitButton).toHaveAttribute('aria-disabled', 'false');
}
);
},
Expand Down

0 comments on commit 4986347

Please sign in to comment.