Skip to content

Commit

Permalink
Add complementary test case
Browse files Browse the repository at this point in the history
  • Loading branch information
fullofcaffeine committed May 25, 2024
1 parent bd8c12e commit 6c3cda1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/components/src/progress-bar/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe( 'ProgressBar', () => {
expect( screen.getByRole( 'progressbar' ) ).toHaveStyle( style );
} );

it( 'should expand to fit the parent when `hasUnconstrainedWidth` is true', () => {
it( 'should expand to fit the parent when `hasUnconstrainedWidth` is `true`', () => {
const { container } = render( <ProgressBar hasUnconstrainedWidth /> );

// eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
Expand All @@ -90,4 +90,15 @@ describe( 'ProgressBar', () => {
'max-width': '160px',
} );
} );

it( 'should have a default `max-width` when `hasUnconstrainedWidth` is `false`', () => {
const { container } = render( <ProgressBar /> );

// eslint-disable-next-line testing-library/no-container, testing-library/no-node-access
const track = container.firstChild;

expect( track ).toHaveStyle( {
'max-width': '160px',
} );
} );
} );

0 comments on commit 6c3cda1

Please sign in to comment.