Skip to content

Commit

Permalink
getByText => getByRole
Browse files Browse the repository at this point in the history
  • Loading branch information
ciampo committed Oct 8, 2024
1 parent b7b4f7a commit 72bc7d6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/components/src/composite/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,19 @@ describe( 'Composite', () => {
);

await press.Tab();
expect( screen.getByText( 'Before' ) ).toHaveFocus();
expect(
screen.getByRole( 'button', { name: 'Before' } )
).toHaveFocus();
await press.Tab();
expect( screen.getByText( 'Item 1' ) ).toHaveFocus();
expect(
screen.getByRole( 'button', { name: 'Item 1' } )
).toHaveFocus();
await press.Tab();
expect( screen.getByText( 'After' ) ).toHaveFocus();
expect( screen.getByRole( 'button', { name: 'After' } ) ).toHaveFocus();
await press.ShiftTab();
expect( screen.getByText( 'Item 1' ) ).toHaveFocus();
expect(
screen.getByRole( 'button', { name: 'Item 1' } )
).toHaveFocus();
} );

test( 'Excludes disabled items', async () => {
Expand Down

0 comments on commit 72bc7d6

Please sign in to comment.