Skip to content

fix(testing): wait for the API keys expiration dropdown instead of force-clicking - #10647

Open
alexcarpenter wants to merge 2 commits into
mainfrom
carp/api-keys-select-flake
Open

alexcarpenter wants to merge 2 commits into
mainfrom
carp/api-keys-select-flake

Conversation

@alexcarpenter

Copy link
Copy Markdown
Member

Description

api keys component @machine › can create api keys flakes. In CI logs, the "Create key" click times out because an open expiration option list covers it (cl-selectOption__apiKeyExpiration … intercepts pointer events, jobs 126228362574 and 126335179987).

selectExpiration force-clicks the option text. force: true was added in #6999, the same commit that added an absolutely positioned ::before to each option. A force click skips Playwright's stability check, so it can fire while the list is still animating open. When it misses, nothing is selected and the list stays open.

selectExpiration now:

  • clicks the trigger by its stable class (.cl-selectButton__apiKeyExpiration), since its "Select date" label changes once a value is chosen
  • waits for aria-expanded="true"
  • clicks the option by role, without force
  • waits for aria-expanded="false"

The list not closing now fails at the step where it happens, instead of as a timeout on a later click.

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@vercel

vercel Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Nov 4, 2026 4:45pm UTC
swingset Ready Ready Preview Nov 4, 2026 4:45pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f5f980e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@clerk/testing Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
Commits

Reviewing files that changed from the base of the PR and between e7580d7 and f5f980e.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

selectExpiration now opens the expiration dropdown, checks that it is expanded, selects the exact matching option (defaulting to never), and checks that it is collapsed. A patch changeset records this update.

Estimated code review effort: 2 (Simple) | ~8 minutes

Suggested reviewers: austincalvelage

Merge Risk: Minimal · previous review e7580

The change is mergeable with no identified actionable risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the main change: selectExpiration in the API keys page object now waits for the expiration dropdown to open and close instead of force-clicking an option. It also names the area (testi…
Description check Passed The description states the flaky test, the CI error (an open expiration option list intercepts pointer events), and the cause (force-clicking option text skips the stability check). It then lists the …
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: selectExpiration in the API keys page object now waits for the expiration dropdown to open and close instead of force-clicking an option. It also names the area (testing package) and the fix type. The title is specific and matches the changeset, so it passes.

Full details: Description check

Explanation

The description states the flaky test, the CI error (an open expiration option list intercepts pointer events), and the cause (force-clicking option text skips the stability check). It then lists the new steps in selectExpiration: click by stable class, wait for aria-expanded true, click by role without force, and wait for aria-expanded false. These match the changes in apiKeys.ts and the changeset, so the description passes.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files. (1 skipped: 1 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: Some configured repositories could not be included in this review. Cross-repository analysis may be incomplete. Please check linked-repository access and settings.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 6acfb99 and e7580d7.

Files selected for processing: 2
  • .changeset/api-keys-select-expiration.md
  • packages/testing/src/playwright/unstable/page-objects/apiKeys.ts
Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

@pkg-pr-new

pkg-pr-new Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@10647

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@10647

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@10647

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@10647

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@10647

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@10647

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@10647

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@10647

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@10647

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10647

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@10647

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@10647

@clerk/express

npm i https://pkg.pr.new/@clerk/express@10647

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@10647

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@10647

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@10647

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10647

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@10647

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@10647

@clerk/react

npm i https://pkg.pr.new/@clerk/react@10647

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@10647

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@10647

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@10647

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@10647

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@10647

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@10647

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@10647

commit: f5f980e

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-11-04T16:50:24.049Z

Summary

Metric Count
Packages analyzed 20
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on f5f980e.

This branch was successfully deployed

2 active deployments
Preview – swingset — f5f980ed Deployed Nov 4, 2026 by vercel[bot]
Preview – clerk-js-sandbox — f5f980ed Deployed Nov 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants