test: run the refresh modules in a real browser - #21
Merged
Conversation
Greptile SummaryAdds real-browser integration coverage for component refresh behavior using Playwright, Chromium, and Turbo.
Confidence Score: 5/5The PR appears safe to merge with no concrete blocking or independently actionable non-blocking issues identified. The browser harness is isolated to loopback, current test inputs are controlled fixtures, dependency installation remains lockfile-backed, and the new CI path consistently exercises the added suite. Important Files Changed
Reviews (1): Last reviewed commit: "test: run the refresh modules in a real ..." | Re-trigger Greptile |
Four batching defects reached production this session and every one passed the jsdom suite, because jsdom cannot model Turbo applying a morph, task boundaries between socket deliveries, or abort semantics. Each was fixed by first repairing the harness. Add a Playwright suite that serves the real modules alongside a real Turbo build and drives Chromium, covering component_refresh.js, which had no tests at all.
cardmagic
force-pushed
the
agent/browser-tests
branch
from
August 10, 2026 14:30
7a2ccb5 to
698726b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Roadmap milestone 5, the browser-coverage half.
Why this first
Four defects reached production this session: the batch endpoint's
Acceptheader, notifications arriving in separate tasks, unconditional aborts, and same-revision requests overwriting each other. Every one passed the jsdom suite. Each was fixed by first repairing the harness, not the module: jsdom did not send the header a browser sends, did not deliver across task boundaries, and ignored abort signals.jsdom also cannot model the thing these modules exist to trigger: Turbo applying a stream to a live document.
What this adds
A Playwright suite serving the real browser modules alongside a real
@hotwired/turbobuild, driving headless Chromium against a local HTTP server that answers component requests.Five tests, all against
component_refresh.js, which previously had zero tests despite driving every individual morph refresh:missing_framedata-turbo-permanent, which is only observable with real TurboThat last one is the point of the exercise: it asserts a property the jsdom suite is structurally incapable of checking.
Layering
npm testkeeps the fast jsdom suite for logic;npm run test:browserruns the slower browser suite for integration with Turbo. CI runs both in the existingjavascriptjob, installing Chromium with--with-deps.Roadmap
The "Browser module coverage" gap is removed, since every module now has tests. Milestone 4 is narrowed to Turbo append intents, noting reconnect scenarios are still not covered in a browser. Per #15.
Honest scope
This covers the refresh modules against real Turbo. It does not yet cover reconnect convergence, a real Action Cable connection, or the batch and payload modules in-browser; those remain on the milestone. This is the harness plus the highest-value gap, not the whole milestone.