You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Inclined to believe that the issue is with the test, rather than the functionality, because while the test is new, the functionality has mostly been unchanged since it was first created over a year ago
Testing clipboard functionality is weird in general, so depending on what's found after digging, it might be better to make some E2E tests instead
Though obviously it'd be better to have a single test for the clipboard, rather than needing to have ad-hoc tests for everything that just happens to use the clipboard
The main issue is that React Testing Library will inject a clipboard mock the moment you try to set up any kind of user session with user.setup. This is great most of the time, but the problem is that the clipboard always succeeds, and there's no way to remove the mock. Once there's a single setup, the entire test is basically "tainted" with false positives
Because the tests actually need to verify that the fallback functionality works when a clipboard isn't available on HTTP-only connection, we can't use user.setup at all
The text was updated successfully, but these errors were encountered:
Parkreiner
changed the title
Test flake: useClipboard doesn't consistently apply state changes
Test flake: Tests for useClipboard don't consistently flush state changes
May 10, 2024
Issue
useClipboard
don't consistently succeed. Previous failures:Notes
user.setup
. This is great most of the time, but the problem is that the clipboard always succeeds, and there's no way to remove the mock. Once there's a single setup, the entire test is basically "tainted" with false positivesuser.setup
at allThe text was updated successfully, but these errors were encountered: