Skip to content

Fixed navigation race in Admin sidebar acceptance test - #29323

Merged
9larsons merged 1 commit into
mainfrom
codex/fix-admin-sidebar-acceptance-race
Jul 14, 2026
Merged

Fixed navigation race in Admin sidebar acceptance test#29323
9larsons merged 1 commit into
mainfrom
codex/fix-admin-sidebar-acceptance-race

Conversation

@9larsons

Copy link
Copy Markdown
Contributor

What changed

  • Wait for the Network navigation to settle on the ActivityPub onboarding route.
  • Wait for the subsequent Posts navigation to complete before asserting that the notification badge is restored.

Why

The test accepted the transient /network route even though its loader redirects into ActivityPub. It could then click Posts while the ActivityPub redirect was still pending. When that redirect won the race, the test remained on ActivityPub and the badge was correctly hidden, causing the recurring CI failure.

Impact

This makes the sidebar acceptance test deterministic without changing production behavior or Vite dependency optimization.

Validation

  • pnpm nx run @tryghost/admin:test:acceptance -- src/layout/sidebar.acceptance.test.tsx — 16 tests passed
  • pnpm --dir apps/admin exec eslint src/layout/sidebar.acceptance.test.tsx

no ref

The Network route redirects through ActivityPub onboarding, so waiting for transient paths allowed the redirect to race the subsequent Posts navigation.
@coderabbitai

coderabbitai Bot commented Jul 14, 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: CHILL

Plan: Pro

Run ID: fc2ecce7-46d6-459d-9b7a-7b5c0f5a5b9f

📥 Commits

Reviewing files that changed from the base of the PR and between 6a19084 and a1fd18e.

📒 Files selected for processing (1)
  • apps/admin/src/layout/sidebar.acceptance.test.tsx

Walkthrough

The sidebar acceptance test now asserts that selecting Network navigates to /activitypub/welcome/1 and selecting Posts navigates to /posts. It continues verifying that the Network unread badge disappears on the Network route and reappears after navigating to Posts.

Possibly related PRs

Suggested reviewers: kevinansfield

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: fixing a navigation race in the Admin sidebar acceptance test.
Description check ✅ Passed The description matches the change set and explains the test stabilization and validation steps.
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.
✨ 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-sidebar-acceptance-race

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@nx-cloud

nx-cloud Bot commented Jul 14, 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 a1fd18e

Command Status Duration Result
nx run-many --target=build --projects=tag:publi... ✅ Succeeded 3s View ↗
nx run @tryghost/admin:build ✅ Succeeded 2m 31s View ↗
nx run-many -t test:unit -p @tryghost/admin ✅ Succeeded 1m 55s View ↗
nx run ghost-monorepo:lint:boundaries ✅ Succeeded <1s View ↗
nx run-many -t lint -p @tryghost/admin ✅ Succeeded 48s View ↗
nx run @tryghost/admin:test:acceptance ✅ Succeeded 56s View ↗
nx run ghost:build:assets ✅ Succeeded 1s View ↗
nx run ghost:build:tsc ✅ Succeeded 8s View ↗

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


☁️ Nx Cloud last updated this comment at 2026-07-14 17:51:33 UTC

@9larsons
9larsons marked this pull request as ready for review July 14, 2026 17:49
@9larsons
9larsons enabled auto-merge (squash) July 14, 2026 17:49
@9larsons
9larsons merged commit 0994574 into main Jul 14, 2026
43 checks passed
@9larsons
9larsons deleted the codex/fix-admin-sidebar-acceptance-race branch July 14, 2026 18:01
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