Skip to content

test(review): repair guide virtualization mock and run its tests in CI - #1200

Merged
backnotprop merged 1 commit into
mainfrom
fix/guide-virtualization-test-ci
Aug 5, 2026
Merged

test(review): repair guide virtualization mock and run its tests in CI#1200
backnotprop merged 1 commit into
mainfrom
fix/guide-virtualization-test-ci

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

What broke

AllFilesCodeView.lifecycle.test.tsx stubs @pierre/diffs/react with mock.module, which replaces the entire specifier. #1193 added an EditProvider import to AllFilesCodeView.tsx, but the stub was not extended, so the file threw SyntaxError: Export named 'EditProvider' not found at import. The stub now provides every value export the component reads.

Why nobody noticed

Two reasons stacked. The file was masked in any run that also loaded useEditSession.recovery.test.tsx first, which pulls in the real module. And the three DOM tests #1158 added for Guided Review virtualization were never registered in the DOM_TESTS=1 CI step, so plain bun test skipped them and they never ran at all.

What the tests guard

GuideViewportManager caps live Pierre CodeView instances at 8 while Guided Review renders one card per file. Before #1158 all of them mounted: roughly 1.07M shadow DOM elements, 770MB heap, 3.9 FPS. GuideView.test.tsx and GuideSectionCard.test.tsx assert the cap holds.

CI cost

The DOM step goes from about 14.8s to about 16.9s locally, a delta of roughly +2.1s.

Verified non-vacuous: lifting the enforced cap while pinning the assertion bound at 8 fails two GuideView.test.tsx cases (20 and 9 mounted views). Probe reverted. Full suite: 2875 pass, 0 fail.

The AllFilesCodeView lifecycle test stubs '@pierre/diffs/react' with
mock.module, which replaces the whole specifier. #1193 added an
EditProvider import to AllFilesCodeView, but the stub was never
extended, so the file throws at import when run on its own.

The three DOM tests #1158 added for Guided Review virtualization were
also never registered in the DOM_TESTS=1 CI step, so nothing enforced
the 8-viewer mount cap and nothing surfaced the broken stub.
@backnotprop
backnotprop merged commit 6b8723c into main Aug 5, 2026
14 of 15 checks passed
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