Skip to content

Commit

Permalink
Adjust more tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
afercia committed Jan 10, 2025
1 parent 8e23dc8 commit bfc0955
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/components/src/color-palette/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ describe( 'ColorPalette', () => {
/>
);

expect(
screen.getAllByRole( 'option', { name: /^Color:/ } )
).toHaveLength( 3 );
expect( screen.getAllByRole( 'option' ) ).toHaveLength( 3 );
} );

it( 'should call onClick on an active button with undefined', async () => {
Expand All @@ -67,9 +65,7 @@ describe( 'ColorPalette', () => {
/>
);

await user.click(
screen.getByRole( 'option', { name: /^Color:/, selected: true } )
);
await user.click( screen.getByRole( 'option', { selected: true } ) );

expect( onChange ).toHaveBeenCalledTimes( 1 );
expect( onChange ).toHaveBeenCalledWith( undefined );
Expand All @@ -91,7 +87,6 @@ describe( 'ColorPalette', () => {
// (i.e. a button representing a color that is not the current color)
await user.click(
screen.getAllByRole( 'option', {
name: /^Color:/,
selected: false,
} )[ 0 ]
);
Expand Down Expand Up @@ -230,7 +225,6 @@ describe( 'ColorPalette', () => {
// Click the first unpressed button
await user.click(
screen.getAllByRole( 'option', {
name: /^Color:/,
selected: false,
} )[ 0 ]
);
Expand Down

0 comments on commit bfc0955

Please sign in to comment.