Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
Closes #98
Description (What does it do?)
This PR changes one test that was being problematic.
How
can this behas this been tested?.each()
block, repeated it 100 times, on both CI and locally. See https://github.com/mitodl/mit-open/actions/runs/6301758705/job/17107497440?pr=100findByRole
query, and repeated (1), running 100 tests. See https://github.com/mitodl/mit-open/actions/runs/6301882578So, the test is a lot faster now.
Additional Context
Testing Library's
*byRole
queiries are their recommended query because they provide a number of accessibility checks, but they apparently slower than related queries that do not make similar accessibility checks (e.g.,*byText*
). See for example:But the performance is getting better: The unreleased branch of
jest-environment-jsdom
uses JSDom v22 (we're on v20). Trying that locally brought 100 repetitions down to undo 40 seconds.