Repository navigation
test(compliance): wait for the import button to enable before clicking it (#1497) - #1498
Merged
Merged
Conversation
…g it (#1497) Signed-off-by: alex-dembele <alexandredembele16@gmail.com>
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1497
Cause
This is a race in the test, not a timeout.
pick()inCustomFrameworkImportPage.tsxcallssetFile(f)beforeawait f.text().disabled={!document}) until the file has been parsed.fireEvent.click(await findByRole(button))could click it while it was still disabled, which does nothing.Fix (test only)
clickImport()helper waits for the button to be enabled before clicking. It replaces the three call sites.framework-import-preview, which only renders once the document is parsed.Proof
file.text()artificially delayed by 200 ms, the original file fails 6/15: all the cases that click Import fail, the same way CI did. The fixed file passes 15/15.--pool=forks --maxWorkers=1. Prettier and eslint are clean.Review
code-reviewer PASS on
c37f8bf1. devsecops is not needed: the change is test-only.Effect elsewhere
This unblocks the red Frontend Unit Tests check on #1496 (#591) and on the merge queue, where the same file failed for #1495.