-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#5039] Show nonFieldErrors on the top of the modal
Backport-of: #5098
- Loading branch information
1 parent
2df9ce1
commit 4b1ecdf
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -937,6 +937,51 @@ export const Email = { | |
}, | ||
}; | ||
|
||
export const EmailValidationNonFieldErrors = { | ||
args: { | ||
configuredBackends: [ | ||
{ | ||
key: 'backend3', | ||
name: 'Email', | ||
backend: 'email', | ||
options: { | ||
toEmails: ['[email protected]'], | ||
attachmentFormats: [], | ||
paymentEmails: [], | ||
attachFilesToEmail: false, | ||
email_subject: '', | ||
email_payment_subject: '', | ||
email_content_template_html: '', | ||
email_content_template_text: '', | ||
}, | ||
}, | ||
], | ||
validationErrors: [ | ||
[ | ||
'form.registrationBackends.0.options.nonFieldErrors', | ||
'Both email_content_template_html and email_content_template_text are required', | ||
], | ||
['form.registrationBackends.0.options.email_content_template_text', 'Specific field error'], | ||
], | ||
}, | ||
|
||
play: async ({canvasElement}) => { | ||
const canvas = within(canvasElement); | ||
|
||
await userEvent.click(canvas.getByRole('button', {name: 'Opties instellen'})); | ||
|
||
const modalForm = await screen.findByTestId('modal-form'); | ||
await expect(modalForm).toBeVisible(); | ||
const modal = within(modalForm); | ||
|
||
await expect( | ||
modal.getByText( | ||
'Both email_content_template_html and email_content_template_text are required' | ||
) | ||
).toBeVisible(); | ||
}, | ||
}; | ||
|
||
export const STUFZDS = { | ||
name: 'StUF ZDS', | ||
args: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters