From 5075de319aa9b39d3a7a9659d875935a5fa5a02c Mon Sep 17 00:00:00 2001 From: Mitchell Austin Date: Thu, 18 Jan 2024 22:32:33 -0800 Subject: [PATCH] Update unit test --- packages/components/src/modal/test/index.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/components/src/modal/test/index.tsx b/packages/components/src/modal/test/index.tsx index b53e12b450a171..8d9c4500d9f979 100644 --- a/packages/components/src/modal/test/index.tsx +++ b/packages/components/src/modal/test/index.tsx @@ -234,7 +234,7 @@ describe( 'Modal', () => { // Opens outer modal > hides container. await user.click( screen.getByRole( 'button', { name: 'Start' } ) ); - expect( container ).toHaveAttribute( 'aria-hidden', 'true' ); + expect( container ).toHaveAttribute( 'inert' ); // Disable reason: No semantic query can reach the overlay. // eslint-disable-next-line testing-library/no-node-access @@ -242,16 +242,16 @@ describe( 'Modal', () => { // Opens inner modal > hides outer modal. await user.click( screen.getByRole( 'button', { name: 'Nest' } ) ); - expect( outer ).toHaveAttribute( 'aria-hidden', 'true' ); + expect( outer ).toHaveAttribute( 'inert' ); // Closes inner modal > Unhides outer modal and container stays hidden. await user.keyboard( '[Escape]' ); - expect( outer ).not.toHaveAttribute( 'aria-hidden' ); - expect( container ).toHaveAttribute( 'aria-hidden', 'true' ); + expect( outer ).not.toHaveAttribute( 'inert' ); + expect( container ).toHaveAttribute( 'inert' ); // Closes outer modal > Unhides container. await user.keyboard( '[Escape]' ); - expect( container ).not.toHaveAttribute( 'aria-hidden' ); + expect( container ).not.toHaveAttribute( 'inert' ); } ); it( 'should render `headerActions` React nodes', async () => {