Skip to content

Fixed flaky membership tier access acceptance test - #30320

Merged
9larsons merged 1 commit into
mainfrom
codex/fix-admin-tier-selector-flake
Aug 26, 2026
Merged

Fixed flaky membership tier access acceptance test#30320
9larsons merged 1 commit into
mainfrom
codex/fix-admin-tier-selector-flake

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

Summary

  • Scope tier option lookup to the open command listbox.
  • Wait for each tier option to become visible before clicking it.
  • Match tier names exactly to avoid unrelated option matches.

This removes the race between the asynchronous mocked tiers request and the React Query result rendering in the combobox. The same timeout occurred in multiple CI runs, including the linked failure.

Testing

  • CI=1 pnpm --filter @tryghost/admin exec vitest run -c vitest.acceptance.config.ts src/settings/membership/access.acceptance.test.tsx
  • pnpm nx run @tryghost/admin:typecheck
  • pnpm nx run @tryghost/admin:lint

No changeset is required because this is an internal acceptance-test fix.

no ref

Wait for tier options to render in the open listbox and select them by exact accessible name. This removes the race between the mocked tiers request and the React query result becoming available in the combobox.
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: QUIET

Plan: Pro Plus

Run ID: daa03ece-8ac8-42b5-ac0c-9e82a225eeeb

📥 Commits

Reviewing files that changed from the base of the PR and between 1f649bc and 2d5ee8b.

📒 Files selected for processing (2)
  • apps/admin/src/settings/membership/access.acceptance.test.tsx
  • apps/admin/src/settings/settings.screen.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (10)
  • GitHub Check: Build E2E Public App Assets
  • GitHub Check: App Playwright Acceptance Tests (@tryghost/admin)
  • GitHub Check: Unit tests (Node 22.23.1)
  • GitHub Check: Build Admin
  • GitHub Check: Build Docker Images
  • GitHub Check: Stripe fixture checks
  • GitHub Check: Check migration integrity
  • GitHub Check: Check app version bump
  • GitHub Check: Lint
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (7)
Review Admin UI for existing Shade reuse, correct component layer, semantic

⚙️ CodeRabbit configuration file

Files:

  • apps/admin/src/settings/membership/access.acceptance.test.tsx
  • apps/admin/src/settings/settings.screen.ts
Review whether tests prove changed behaviour, meaningful error/edge paths, and

⚙️ CodeRabbit configuration file

Files:

  • apps/admin/src/settings/membership/access.acceptance.test.tsx
Review lens: "where does this data become trusted?"

⚙️ CodeRabbit configuration file

Files:

  • apps/admin/src/settings/membership/access.acceptance.test.tsx
  • apps/admin/src/settings/settings.screen.ts
Prioritise concrete correctness, security, data-integrity, compatibility,

⚙️ CodeRabbit configuration file

Files:

  • apps/admin/src/settings/membership/access.acceptance.test.tsx
  • apps/admin/src/settings/settings.screen.ts
Type-safe boundaries: Fail only if the PR:

📄 CodeRabbit inference engine (Custom checks)

Files:

  • apps/admin/src/settings/membership/access.acceptance.test.tsx
  • apps/admin/src/settings/settings.screen.ts
Build new features in React,

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • apps/admin/src/settings/membership/access.acceptance.test.tsx
  • apps/admin/src/settings/settings.screen.ts
Always use `pnpm`, never npm or Yarn.

📄 CodeRabbit inference engine (AGENTS.md)

Files:

  • apps/admin/src/settings/membership/access.acceptance.test.tsx
  • apps/admin/src/settings/settings.screen.ts
🔇 Additional comments (2)
apps/admin/src/settings/settings.screen.ts (1)

53-54: LGTM!

apps/admin/src/settings/membership/access.acceptance.test.tsx (1)

237-243: LGTM!


Walkthrough

Added settingsScreen.tierOption(name) to locate exact-name options in the settings listbox. Updated the membership access acceptance test to use this locator for the Basic Supporter and Ultimate Starlight Diamond Tier options. The test retains its visibility assertions and saved settings payload verification.

Merge Risk: ⚪ Minimal · up to 2d5ee

This change makes the membership access acceptance test wait for and precisely select tier options; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: fixing a flaky membership tier access acceptance test.
Description check ✅ Passed The description directly explains the test flakiness fix, the locator and visibility changes, the race condition, and the validation performed.
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.
Type-Safe Boundaries ✅ Passed PASS. The commit changes only an acceptance test and the test-only settingsScreen locator module. The added tierOption(name) helper constructs a Playwright-style locator from a string; it does not…
New Files Are Typescript ✅ Passed The pull request adds no files. The diff against origin/main contains only modifications to access.acceptance.test.tsx and settings.screen.ts. It adds no .js, .jsx, .cjs, or .mjs source fi…
Full details: Type-Safe Boundaries

Explanation

PASS. The commit changes only an acceptance test and the test-only settingsScreen locator module. The added tierOption(name) helper constructs a Playwright-style locator from a string; it does not consume HTTP/API, environment, database, filesystem, queue, or event data. The diff adds no any, unchecked as, @ts-ignore, or @ts-nocheck, and the acceptance-test changes are explicitly exempt by this check.

Full details: New Files Are Typescript

Explanation

The pull request adds no files. The diff against origin/main contains only modifications to access.acceptance.test.tsx and settings.screen.ts. It adds no .js, .jsx, .cjs, or .mjs source file, so the failure condition does not apply.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-admin-tier-selector-flake

Comment @coderabbitai help to get the list of available commands.

@nx-cloud

nx-cloud Bot commented Aug 26, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 2d5ee8b

Command Status Duration Result
nx run @tryghost/admin:test:acceptance ✅ Succeeded 7m 34s View ↗
nx run-many -t test:unit -p @tryghost/admin ✅ Succeeded 1m 50s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded 19s View ↗
nx run-many -t lint -p @tryghost/admin,ghost-mo... ✅ Succeeded 3s View ↗
nx run @tryghost/admin:build ✅ Succeeded 17s View ↗
nx run-many --target=build --projects=tag:publi... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-08-26 14:41:52 UTC

@9larsons
9larsons merged commit 0b96311 into main Aug 26, 2026
51 checks passed
@9larsons
9larsons deleted the codex/fix-admin-tier-selector-flake branch August 26, 2026 14:51
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.

1 participant