Skip to content

Commit

Permalink
updatrd test for Toast focus change
Browse files Browse the repository at this point in the history
  • Loading branch information
ktabors authored and majornista committed Mar 22, 2024
1 parent 26a9706 commit 4a5b892
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/@react-spectrum/toast/test/ToastContainer.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ describe('Toast Provider and Container', function () {
expect(document.activeElement).toBe(button);
});

it('should move focus to remaining toast close button when a toast exits and there are more', () => {
it('should move focus to remaining toast when a toast exits and there are more', () => {
let {getAllByRole, getByRole, queryByRole} = renderComponent(<RenderToastButton />);
let button = getByRole('button');

Expand All @@ -248,10 +248,9 @@ describe('Toast Provider and Container', function () {
fireAnimationEnd(toast);

toast = getByRole('alert');
closeButton = within(toast).getByRole('button');

expect(document.activeElement).toBe(closeButton);
expect(document.activeElement).toBe(toast);

closeButton = within(toast).getByRole('button');
triggerPress(closeButton);
fireAnimationEnd(toast);

Expand Down

0 comments on commit 4a5b892

Please sign in to comment.