test(components): restore web and html-reporter component tests#41889
test(components): restore web and html-reporter component tests#41889pavelfeldman wants to merge 2 commits into
Conversation
expect.fn() creates a mock function that records calls, results and settled results. Mock assertions like toHaveBeenCalledWith() and toHaveResolvedWith() are asynchronous and retried until they pass or the expect timeout is reached, so mocks can be handed to concurrent code, e.g. exposed into the page via page.evaluate(). Assertions whose outcome can no longer change fail fast instead of waiting. Implementations are async-only because they run in the test process. Values set with mockReturnValue() are serialized along with the function and consumed synchronously by the page-side callback stub.
Restores the component tests deleted in microsoft#38187 on top of the built-in mount fixture: each package hosts a story gallery page, stories live next to the components, and specs drive them via mount(storyId, props). Callback props are asserted with expect.fn() mocks, including a Chip body render prop served synchronously via mockReturnValue().
a3f8720 to
05859c6
Compare
Test results for "MCP"2 failed 7758 passed, 1249 skipped Merge workflow run. |
🟢 CI is clear — both failures are pre-existing MCP flakesHi, I'm the Playwright bot and I took a first look at the CI failures. Neither of the two failing tests is caused by this PR — both are long-standing flakes that fail across many unrelated PRs, and this PR touches no MCP code. DetailsThis PR restores component tests and adds Pre-existing flake / infra
Nothing here reaches the diff — safe to rerun. Triaged by the Playwright bot - agent run |
Test results for "tests 1"2 failed 6 flaky50221 passed, 1189 skipped Merge workflow run. |
🔴 One failure is caused by this PR — a new
|
Summary
mountfixture and the story-gallery setup from the component-testing skill.playwright/gallerypage served by Vite (html-reporter reuses its dev server,packages/webgets a minimal standalone config).test-html-reporter/test-webnpm scripts and the Web Components CI job restored.expect.fn()mocks, adding coverage the old suite never had:CodeMirrorWrapper.onChange(with read-only negative),Expandable.expandOnTitleClick(both branches), and aChip.bodyrender prop served synchronously viamockReturnValue().Depends on #41884.