Open suejung-sentry opened 6 days ago
so far me and @calvin-codecov have seen this happen
My failure was
FAIL src/pages/RepoPage/CoverageTab/OverviewTab/subroute/ComponentsMultiSelect/ComponentsMultiSelect.test.tsx > ComponentsMultiSelect > when searching for a component > falls back to substring search when bad regex is provided
TestingLibraryElementError: Unable to find an element with the text: component-1. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
Ignored nodes: comments, script, style
<body>
<div
aria-live="polite"
aria-relevant="additions text"
id="a11y-status-message"
role="status"
style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;"
/>
<div />
</body>
Ignored nodes: comments, script, style
<body>
<div
aria-live="polite"
aria-relevant="additions text"
id="a11y-status-message"
role="status"
style="border: 0px; height: 1px; margin: -1px; overflow: hidden; padding: 0px; position: absolute; width: 1px;"
/>
<div />
</body>
❯ waitForWrapper node_modules/@testing-library/dom/dist/wait-for.js:163:27
❯ node_modules/@testing-library/dom/dist/query-helpers.js:86:33
❯ src/pages/RepoPage/CoverageTab/OverviewTab/subroute/ComponentsMultiSelect/ComponentsMultiSelect.test.tsx:271:39
269| await user.click(select)
270|
271| const component1 = await screen.findByText('component-1')
| ^
272| expect(component1).toBeInTheDocument()
273| const component2 = await screen.findByText('component-2')
but I fixed it with https://github.com/codecov/gazebo/pull/3363/commits/5aa73e58bb594faf9b2c63662873498ec1444de6
Describe the bug There seem to be flaky tests related to the multi-select component when running
yarn test:vite
. From what I can tell, within the test, we render the multi-select component, click to trigger it to open, then look for the text expected in one of the options of the open multi-select component dropdown. BUT some of the time, the component isn't opening by the time we are looking for the text. The awaits in the test don't seem to be awaiting.Example of a multi select component
The files I've seen this happen in are:
(error is really long - posted at the bottom of this)
To Reproduce Steps to reproduce the behavior:
yarn test:vite src/ui/FileViewer/ToggleHeader/Title/Title.test.tsx
a handful of times and see it fail some of the timeyarn test:vite src/pages/RepoPage/CoverageTab/OverviewTab/subroute/ComponentsMultiSelect/ComponentsMultiSelect.test.tsx
Expected behavior A clear and concise description of what you expected to happen. Expect it to always pass
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
desktop, vscode
Additional context Add any other context about the problem here.
Here's the really long error message referenced in the description