Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
madhusudhand committed Dec 23, 2022
1 parent 6aaf5f1 commit b99bc23
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/components/src/tab-panel/test/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,18 @@ describe( 'TabPanel', () => {
expect( selectedTab ).toHaveTextContent( 'Beta' );
} );

it( 'should render with a tab selected by prop selectedTabName', () => {
render(
<TabPanel
selectedTabName="beta"
tabs={ TABS }
children={ () => undefined }
/>
);
const selectedTab = screen.getByRole( 'tab', { selected: true } );
expect( selectedTab ).toHaveTextContent( 'Beta' );
} );

it( 'should apply the `activeClass` to the selected tab', async () => {
const user = setupUser();
const activeClass = 'my-active-tab';
Expand Down

0 comments on commit b99bc23

Please sign in to comment.