Skip to content

Commit

Permalink
fix combobox test
Browse files Browse the repository at this point in the history
  • Loading branch information
scurker authored and anastasialanz committed Sep 17, 2024
1 parent ca4d643 commit e05e7cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/react/src/components/Combobox/Combobox.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ test('should prevent default with enter keypress and open listbox', () => {
// rtl doesn't let us mock preventDefault
// see: https://github.com/testing-library/react-testing-library/issues/572
event.preventDefault = preventDefault;
if (type === 'focus') {
fireEvent.focusIn(combobox);
}
fireEvent(combobox, event);
};

Expand Down Expand Up @@ -545,6 +548,9 @@ test('should not prevent default with enter keypress and closed listbox', () =>
// rtl doesn't let us mock preventDefault
// see: https://github.com/testing-library/react-testing-library/issues/572
event.preventDefault = preventDefault;
if (type === 'focus') {
fireEvent.focusIn(combobox);
}
fireEvent(combobox, event);
};

Expand Down

0 comments on commit e05e7cb

Please sign in to comment.