From 4986347fc460b0c9f8214146df495da0d98604d1 Mon Sep 17 00:00:00 2001 From: SilviaAmAm Date: Mon, 23 Oct 2023 16:06:42 +0200 Subject: [PATCH] :recycle: [#462] Update stories --- src/components/Summary/Summary.stories.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/Summary/Summary.stories.js b/src/components/Summary/Summary.stories.js index c918d273c..fd4e1e8d8 100644 --- a/src/components/Summary/Summary.stories.js +++ b/src/components/Summary/Summary.stories.js @@ -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(); @@ -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'); } ); },