Skip to content

flake: UsersPage.test.tsx #14535

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dannykopping opened this issue Sep 3, 2024 · 6 comments · Fixed by #14579
Closed

flake: UsersPage.test.tsx #14535

dannykopping opened this issue Sep 3, 2024 · 6 comments · Fixed by #14579
Assignees
Labels
s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks

Comments

@dannykopping
Copy link
Contributor

https://github.com/coder/coder/actions/runs/10680634527/job/29602816185

FAIL src/pages/UsersPage/UsersPage.test.tsx (19.402 s)
  ● UsersPage › suspend user › when it is success › shows a success message

...
      24 | 	const user = userEvent.setup();
      25 | 	// Get the first user in the table
    > 26 | 	const moreButtons = await screen.findAllByLabelText("More options");
         | 	                                 ^
      27 | 	const firstMoreButton = moreButtons[0];
      28 | 	await user.click(firstMoreButton);
      29 |

      at waitForWrapper (node_modules/.pnpm/@testing-library+dom@9.3.3/node_modules/@testing-library/dom/dist/wait-for.js:162:27)
      at node_modules/.pnpm/@testing-library+dom@9.3.3/node_modules/@testing-library/dom/dist/query-helpers.js:86:31
      at findAllByLabelText (src/pages/UsersPage/UsersPage.test.tsx:26:35)
      at Object.suspendUser (src/pages/UsersPage/UsersPage.test.tsx:141:11)
@dannykopping dannykopping added flake s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks labels Sep 3, 2024
@BrunoQuaresma
Copy link
Collaborator

Another failing job just for the record https://github.com/coder/coder/actions/runs/10706938607/job/29685833175?pr=14564

@BrunoQuaresma BrunoQuaresma self-assigned this Sep 4, 2024
@Parkreiner
Copy link
Member

Yeah, just had this trigger for me, too, even though none of my changes affected the users page
https://github.com/coder/coder/actions/runs/10723982103/job/29738578173?pr=14547#logs

The selector itself looks right. The accessibility tree has the label, and it's also using that as its accessible name, so the choice of selecting by name or by label shouldn't matter. findBy selectors should also work fine with our conditional rendering
Preview of accessibility tree for MoreButton

It's gotta be strictly a mock data loading error

BrunoQuaresma added a commit that referenced this issue Sep 6, 2024
By using [Storybook interaction tests](https://storybook.js.org/tutorials/ui-testing-handbook/react/en/interaction-testing/), we improve the developer experience, as we can see what is happening in the browser, use browser tools to debug, and snapshot the component after interactions, making our tests more reliable and easier to maintain.

Fixes #14535
@Parkreiner
Copy link
Member

@Parkreiner Parkreiner reopened this Sep 10, 2024
@BrunoQuaresma
Copy link
Collaborator

@BrunoQuaresma
Copy link
Collaborator

Looks like it's not. I checked, and UsersPage.test.tsx does not exist on main anymore. Please close the issue again if the test passes after you update the branch with the current main. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants