Skip to content

chore(site): Try to fix flake test #6848

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

Merged
merged 9 commits into from
Mar 29, 2023
Merged

chore(site): Try to fix flake test #6848

merged 9 commits into from
Mar 29, 2023

Conversation

BrunoQuaresma
Copy link
Collaborator

  • Add a lint for the testing library to avoid bad patterns. I see this being very helpful for non-FE folks
  • Increased the timeout for the loader to disappear. There are a few pages we do 3 ~5 requests to get the data and sometimes 1s is not enough to get them even with mock.

@BrunoQuaresma BrunoQuaresma requested review from kylecarbs and a team March 28, 2023 14:37
@BrunoQuaresma BrunoQuaresma self-assigned this Mar 28, 2023
@BrunoQuaresma BrunoQuaresma requested review from Kira-Pilot and removed request for a team March 28, 2023 14:37
Comment on lines 40 to 42
# These rules are disabled because they can degrade test speed a bit since
# sometimes we need to access the directly in a lower scope to prevent the
# library to fetch a bunch of element
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I don't understand this comment. Could you try to explain a little differently?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, gotcha. Maybe we could link those docs and phrase it slightly differently:
"Occasionally, we must traverse the DOM when querying for an element to avoid the performance costs that come with using selectors like ByRole. You can read more about these performance costs here."

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loved, ty!

it("should show stack when encountering runtime error", () => {
renderComponent()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the benefit of sticking this code scaffolding in the renderComponent util method instead of a beforeEach?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, it is a testing-library role: https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-render-in-setup.md I like not having too much nesting or things that are not running "close" on where it is running, but I have no strong opinions on that so we can just remove it if you think that is not usable at all

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting! Thanks for the link; I remember the nesting article you posted in the dev channel a while back, but I didn't realize the concern was not only abstraction but also mutable variables.
This looks good to me!

@BrunoQuaresma BrunoQuaresma merged commit 175dde1 into main Mar 29, 2023
@BrunoQuaresma BrunoQuaresma deleted the bq/chore-test branch March 29, 2023 19:10
@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants