sui-components icon indicating copy to clipboard operation
sui-components copied to clipboard

test(components/molecule/select): fix flaky onblur test

Open alfdocimo opened this issue 3 years ago โ€ข 2 comments

Category/Component

TASK:

Types of changes

  • [x] ๐Ÿชฒ Bug fix (non-breaking change which fixes an issue)
  • [ ] โœจ New feature (non-breaking change which adds functionality)
  • [ ] ๐Ÿ’ฅ Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] ๐Ÿงพ Documentation
  • [ ] ๐Ÿ“ท Demo
  • [x] ๐Ÿงช Test
  • [ ] ๐Ÿง  Refactor
  • [ ] ๐Ÿ’„ Styles

Description, Motivation and Context

Avoid weird race condition with userEvent.tab() by firing focusIn and focusOut events

Screenshots - Animations

alfdocimo avatar Oct 13 '22 14:10 alfdocimo

STATEMENTS BRANCHES FUNCTIONS LINES
โ‰ โ‰ 0.45โ†“ โ‰ 0.42โ†“ โ‰ 0.61โ†“ โ‰ 0.61โ†“
% 71.65 57.36 58.95 73.42
ABS 2659 / 3711 1495 / 2606 484 / 821 2564 / 3492

github-actions[bot] avatar Oct 13 '22 14:10 github-actions[bot]

STATEMENTS BRANCHES FUNCTIONS LINES
โ‰ โ‰ 0.45โ†“ โ‰ 0.42โ†“ โ‰ 0.61โ†“ โ‰ 0.61โ†“
% 71.65 57.36 58.95 73.42
ABS 2659 / 3711 1495 / 2606 484 / 821 2564 / 3492

github-actions[bot] avatar Oct 14 '22 08:10 github-actions[bot]

Merging this PR. We are aware that there are some issues with focusing in and out of the Karma browser when running the tests. This is why firing an event directly seemed to fix the test. As a temporary workaround we're using fireEvent to trigger the blur event from the node

alfdocimo avatar Oct 21 '22 11:10 alfdocimo