From 4a5b89242c78299cca213f3006b951f30f2240c3 Mon Sep 17 00:00:00 2001 From: Kyle Taborski Date: Thu, 14 Mar 2024 16:46:16 -0700 Subject: [PATCH] updatrd test for Toast focus change --- packages/@react-spectrum/toast/test/ToastContainer.test.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/@react-spectrum/toast/test/ToastContainer.test.js b/packages/@react-spectrum/toast/test/ToastContainer.test.js index 99e6fbe10eb..b9bfd2d74da 100644 --- a/packages/@react-spectrum/toast/test/ToastContainer.test.js +++ b/packages/@react-spectrum/toast/test/ToastContainer.test.js @@ -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(); let button = getByRole('button'); @@ -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);