Skip to content

Commit

Permalink
fix: unit tets
Browse files Browse the repository at this point in the history
Signed-off-by: SuZhou-Joe <[email protected]>
  • Loading branch information
SuZhou-Joe committed Sep 29, 2024
1 parent 5e0329b commit cb4a106
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 24 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,13 @@ describe('<NavGroups />', () => {
/>
);
expect(container).toMatchSnapshot();
expect(container.querySelectorAll('.nav-link-item-btn').length).toEqual(3);
expect(container.querySelectorAll('.nav-link-item-btn').length).toEqual(5);
fireEvent.click(getByTestId('collapsibleNavAppLink-pure'));
expect(navigateToApp).toBeCalledTimes(0);
// The accordion is collapsed by default
expect(queryByTestId('collapsibleNavAppLink-subLink')).toBeNull();

// Expand the accordion
fireEvent.click(getByTestId('collapsibleNavAppLink-pure'));
fireEvent.click(getByTestId('collapsibleNavAppLink-subLink'));
expect(navigateToApp).toBeCalledWith('subLink');
Expand Down

0 comments on commit cb4a106

Please sign in to comment.