/** * @jest-environment jsdom */ import { Button } from '@automattic/components'; import { render, screen } from '@testing-library/react'; import ButtonGroup from '..'; describe( 'ButtonGroup', () => { test( 'should have ButtonGroup class', () => { render( ); expect( screen.getByRole( 'group' ) ).toHaveClass( 'button-group' ); } ); test( 'should contains the same number of .button nodes than ); expect( screen.getAllByRole( 'button' ) ).toHaveLength( 2 ); } ); test( 'should get the busy `is-busy` class when passed the `busy` prop', () => { render( ); expect( screen.getByRole( 'group' ) ).toHaveClass( 'is-busy' ); } ); } );