Skip to content

Commit

Permalink
Update CheckboxControl test
Browse files Browse the repository at this point in the history
  • Loading branch information
mikachan committed Jan 31, 2024
1 parent 42a2613 commit d485776
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Snapshot Diff:
>
<input
class="components-checkbox-control__input"
- id="inspector-checkbox-control-5"
+ id="inspector-checkbox-control-6"
- id="inspector-checkbox-control-6"
+ id="inspector-checkbox-control-7"
type="checkbox"
value="1"
+ />
Expand Down
7 changes: 7 additions & 0 deletions packages/components/src/checkbox-control/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ describe( 'CheckboxControl', () => {
expect( label ).toBeInTheDocument();
} );

it( 'should not render label element if label is not set', () => {
render( <CheckboxControl /> );

const label = screen.queryByRole( 'label' );
expect( label ).not.toBeInTheDocument();
} );

it( 'should render a checkbox in an indeterminate state', () => {
render( <CheckboxControl indeterminate /> );
expect( getInput() ).toHaveProperty( 'indeterminate', true );
Expand Down

0 comments on commit d485776

Please sign in to comment.