Skip to content

Commit

Permalink
Refactor unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
david0xd committed Sep 26, 2023
1 parent e8c9d06 commit 5182032
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ describe('DropdownTab', () => {
it('registers selection', () => {
const { container, getByText } = render(<DropdownTab {...args} />);

fireEvent.click(container.firstChild.firstChild.lastChild);
// Find the clickable element (icon box) in the dropdown that contains
// ArrowDown icon by walking the nested elements
const clickableIconBox = container.firstChild.firstChild.lastChild;
fireEvent.click(clickableIconBox);

const element = getByText(args.options[1].name);

Expand Down

0 comments on commit 5182032

Please sign in to comment.