Repository navigation
test: migrate click_at handler tests to mocks - #3190
Merged
OrKoN merged 1 commit intoOct 16, 2026
Merged
Conversation
OrKoN
self-requested a review
October 16, 2026 08:07
OrKoN
approved these changes
Oct 16, 2026
OrKoN
requested changes
Oct 16, 2026
OrKoN
left a comment
Collaborator
There was a problem hiding this comment.
PTAL at the merge conflicts
twotnguyen
force-pushed
the
test/migrate-click-at-tests-to-mocks
branch
from
October 16, 2026 09:41
2c9ffc1 to
05f1a0f
Compare
Contributor
Author
|
Rebased onto latest |
OrKoN
self-requested a review
October 16, 2026 09:41
OrKoN
approved these changes
Oct 16, 2026
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.
Part of #2639.
The
click_athandler tests launched a real browser only to verify that coordinates and click count reachpage.mouse.click()and that the expected response line is recorded. This migrates them in place tocreateHandlerMocks, followingAGENTS.md:CdpMousefromsrc/third_party/index.tsand stubspage.mouseoncreateMockPuppeteerPage()intests/mocks.ts.click_at›clicks at coordinatesto assertcalledOnceWithExactly(page.pptrPage.mouse.click, 50, 50, {count: 1})andappendResponseLine.click_at›double clicks at coordinatesto assertcount: 2ondblClick: true.includeSnapshot: trueassertingsinon.assert.calledOnce(response.includeSnapshot).Testing
npm run build && NODE_TEST_REPORTER=spec node scripts/test.js tests/tools/input.test.ts --test-name-pattern="click_at": all 3 migrated tests pass in ~140ms (down from ~1800ms).PUPPETEER_EXECUTABLE_PATHpointing at a nonexistent binary, so none of the migrated tests starts Chrome.includeSnapshotcauses the corresponding assertion to fail.eslintandprettierpass with zero errors.