Skip to content

test: await copy created token button before clicking#26174

Open
aqandrew wants to merge 1 commit into
mainfrom
aqandrew/fix-wait-for-token-success-modal
Open

test: await copy created token button before clicking#26174
aqandrew wants to merge 1 commit into
mainfrom
aqandrew/fix-wait-for-token-success-modal

Conversation

@aqandrew

@aqandrew aqandrew commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

fixes DEVEX-375

Replaces getByRole with async findByRole, which returns a promise / rejects if no matching element is found after a default timeout of 1000ms

Co-written with Coder Agents. Relevant chat responses:

[I couldn't repro locally, so I inquired if there was a commit/PR that fixed the flake within the past 3 weeks]

No, this flake has not been fixed. There have been zero commits to CreateTokenPage, CopyButton, CodeExample, or useClipboard.ts since the failing CI run (13bf0e1, May 20).

getByRole is synchronous, so it doesn't wait for the success modal (containing the "Copy code" button) to render after the createToken() mutation resolves. When the mutation is slow, the DOM still shows the form (Cancel / Create token), and the query fails.

@linear-code

linear-code Bot commented Jun 9, 2026

Copy link
Copy Markdown

DEVEX-375

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.

2 participants