Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alert only the string #551

Closed
wants to merge 9 commits into from
Closed

Alert only the string #551

wants to merge 9 commits into from

Conversation

Coread
Copy link
Collaborator

@Coread Coread commented Jul 23, 2024

Description

Only the text part of the notification should be read out as an alert by screen readers.

In this PR I've

  1. removed the role=alert from all the toastify container
  2. added role=alert to the Text in ToastNotification when the content is a string

This requires content other than strings to provide the alert separately.

Links

Links to relevent resources.


// check if toast got removed and the toast is not active anymore
await waitForElementToBeRemoved(() => screen.queryByRole('alert'));
await waitForElementToBeRemoved(screen.getByText(textContent));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this always need to be queryByRole, otherwise its not working correctly, see here:
https://testing-library.com/docs/guide-disappearance/#waiting-for-disappearance

@shnaaz shnaaz marked this pull request as ready for review July 30, 2024 13:22
@Coread Coread closed this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants