Skip to content

test(compliance): wait for the import button to enable before clicking it (#1497) - #1498

Merged
alex-dembele merged 1 commit into
developfrom
bug/1497-import-test-race
Nov 21, 2026
Merged

alex-dembele merged 1 commit into
developfrom
bug/1497-import-test-race

Conversation

@alex-dembele

Copy link
Copy Markdown
Member

Closes #1497

Cause

This is a race in the test, not a timeout.

  • pick() in CustomFrameworkImportPage.tsx calls setFile(f) before await f.text().
  • The "Import the framework" button therefore renders disabled (disabled={!document}) until the file has been parsed.
  • fireEvent.click(await findByRole(button)) could click it while it was still disabled, which does nothing.
  • The case then waited for an error or skeleton that never came. A slow CI runner widens the window.

Fix (test only)

  • A clickImport() helper waits for the button to be enabled before clicking. It replaces the three call sites.
  • The axe case for the previewed state now waits for framework-import-preview, which only renders once the document is parsed.
  • No assertion is changed or weakened.

Proof

  • With 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.
  • With the delay removed: 20/20 consecutive runs under --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.

…g it (#1497)

Signed-off-by: alex-dembele <alexandredembele16@gmail.com>
@alex-dembele
alex-dembele added this pull request to the merge queue Nov 21, 2026
Merged via the queue into develop with commit 58775f7 Nov 21, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(compliance): customFrameworkImportPage.test.tsx is flaky in CI

1 participant