Skip to content

test: Fix stale GitHub-flow screenshot specs - #532

Merged
Ziinc merged 3 commits into
mainfrom
claude/fix-stale-screenshot-specs
Sep 27, 2026
Merged

Ziinc merged 3 commits into
mainfrom
claude/fix-stale-screenshot-specs

Conversation

@Ziinc

@Ziinc Ziinc commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Five scripts/screenshot/specs/ files for GitHub flows failed on main. None of the failures were product bugs; the app had changed and these specs had not kept up.

Fixes

Spec Cause Fix
ci-status-indicator Its features mock predates PREVIEW_FEATURE_IDS Spread the real module and override only FEATURES
cmdk-github-pr-workspace-open The no-PR test used a mock that has since been renamed mockGetCachedPrInfo
checks-tab #502 removed the workspace Checks tab Drive ChecksTab in its new home: the PR detail pane's "Treq checks" section, reached through the GitHub panel with a real workspace for the PR head. Only the gh calls are stubbed. Captures trimmed to the 3-expectation limit
prompt-from-github-issue The sidebar item is labeled "Github" Match the label
create-pr-combined-push The spec typed the commit message before the changed file was listed. The commit form remounts at that point, which dropped the message, so no commit happened and Create PR stayed disabled Wait for feature.txt before typing, as commit-and-create-pr-dropdown already does
The sixth failing spec, sidebar-pr-state-colors, is a real product bug and is fixed in its own PR (stacking from the home repo creates a stray workspace for the home branch).

Verification

  • All five specs pass. create-pr-combined-push was run twice to check for flakiness.
  • Every capture was checked against its expectations.
  • lint and check are clean.
    Generated by Claude Code

@Ziinc Ziinc left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Notes for reviewers explaining why the checks-tab spec was rewritten.


Generated by Claude Code

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a rewrite rather than a patch, because #502 removed the workspace Checks tab. ChecksTab now renders only in the PR detail's "Treq checks" section.

  • The spec renders GitHubPanel directly, the same way pr-create-workspace.spec.tsx does. Only the gh calls are stubbed; workflow discovery, trust and runs use the real backend.
  • The workspace is created with createWorkspace() because it is background state here, not the behavior under test.

Generated by Claude Code

- ci-status-indicator: spread the real features module in the mock so
  PREVIEW_FEATURE_IDS (added since) is defined.
- cmdk-github-pr-workspace-open: the no-PR case used a mock renamed to
  mockGetCachedPrInfo.
- checks-tab: the workspace Checks tab was removed in #502; drive the
  checks panel in its new home, the Treq checks section of a PR's detail
  pane, and trim captures to the 3-expectation limit.
- prompt-from-github-issue: the sidebar item is labeled "Github".
- create-pr-combined-push: wait for the changed file to list before
  typing the commit message; the commit form remounts once changes load,
  which dropped the typed message and left Create PR disabled.
handleMarkFileViewed hashed whatever hunks were in allFileHunks at click
time. While a diff is loading that entry is a placeholder with empty
hunks, so marking a file Viewed early stored the hash of the placeholder.
Once the real hunks arrived, the stale-content effect saw a mismatch and
silently un-marked the file. This is also the root cause of the flaky
reviews "mark a file as viewed" integration test.

Only hash loaded hunks; an empty hash is never treated as stale.

(cherry picked from commit 6ef2cf8)
"hides the message queue when the agentMessageQueue preview is off"
only set the in-memory feature preview store. Rendering the Dashboard
hydrates settings, and hydrateFlags rebuilds every flag from defaults
(all on in test mode) plus persisted settings, so whenever hydration
resolved after the setState the flag flipped back on and the queue
button rendered. Persist the setting through setSetting, as
feature-preview.test.tsx does, and restore it when the test finishes.

(cherry picked from commit 88ab81c)
@Ziinc
Ziinc force-pushed the claude/fix-stale-screenshot-specs branch from f785fe8 to e69babe Compare September 27, 2026 03:29

Ziinc commented Sep 27, 2026

Copy link
Copy Markdown
Collaborator Author

test-js / test:integration failed on 6278063 in two tests. Neither is caused by this PR, which only changes screenshot specs that the integration job doesn't run.

I copied both fixes into this branch (869a45e, e69babe). They become no-ops once #539 and #540 merge.


Generated by Claude Code

@Ziinc
Ziinc merged commit ebc1303 into main Sep 27, 2026
23 checks passed
@Ziinc
Ziinc deleted the claude/fix-stale-screenshot-specs branch September 27, 2026 08:46

This branch was successfully deployed

1 active deployment
preview — e69babe9 Deployed Sep 27, 2026 by Ziinc via build #1294
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