Skip to content

Commit

Permalink
chore: fix tab tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ychhabra-eightfold committed May 3, 2022
1 parent e8c6482 commit a448ab2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/Tabs/Tabs.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ describe('Panel', () => {
wrapper.find('.tab').at(2).simulate('click');
expect(tabClick).toHaveBeenCalledTimes(1);
expect(tabClick).toHaveBeenCalledWith('tab3', expect.any(Object));
});

test('setting value changes tab', async () => {
wrapper = mount(
<Tabs onChange={tabClick} value={'tab3'}>
{tabs.map((tab) => (
<Tab key={tab.value} {...tab} />
))}
</Tabs>
);
expect(wrapper.find('.tab').at(2).hasClass('active')).toEqual(true);
});
});

0 comments on commit a448ab2

Please sign in to comment.