Skip to content

Commit

Permalink
Add an accessible title to the query
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla committed Sep 2, 2022
1 parent 900d463 commit c810609
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
} );
} );

0 comments on commit c810609

Please sign in to comment.