diff --git a/packages/edit-post/src/components/preferences-modal/test/index.js b/packages/edit-post/src/components/preferences-modal/test/index.js index 4a157fd36c263a..b2ab5ae2465cf2 100644 --- a/packages/edit-post/src/components/preferences-modal/test/index.js +++ b/packages/edit-post/src/components/preferences-modal/test/index.js @@ -24,19 +24,25 @@ describe( 'EditPostPreferencesModal', () => { useSelect.mockImplementation( () => true ); useViewportMatch.mockImplementation( () => true ); render( <EditPostPreferencesModal /> ); - expect( screen.getByRole( 'dialog' ) ).toMatchSnapshot(); + expect( + screen.getByRole( 'dialog', { name: 'Preferences' } ) + ).toMatchSnapshot(); } ); it( 'small viewports', () => { useSelect.mockImplementation( () => true ); useViewportMatch.mockImplementation( () => false ); render( <EditPostPreferencesModal /> ); - expect( screen.getByRole( 'dialog' ) ).toMatchSnapshot(); + expect( + screen.getByRole( 'dialog', { name: 'Preferences' } ) + ).toMatchSnapshot(); } ); } ); it( 'should not render when the modal is not active', () => { useSelect.mockImplementation( () => false ); render( <EditPostPreferencesModal /> ); - expect( screen.queryByRole( 'dialog' ) ).not.toBeInTheDocument(); + expect( + screen.queryByRole( 'dialog', { name: 'Preferences' } ) + ).not.toBeInTheDocument(); } ); } );