Task Summary
Enable Vitest browser mode (Playwright-driven) for the specs that exercise jointjs paper geometry. Right now they run under jsdom with a stub SVG polyfill — enough for jointjs to instantiate, not enough to compute the graph layout the assertions depend on.
Currently affected
-
workflow-editor.component.spec.ts — entire suite (JointJS Paper + External Module Integration, ~22 tests). Every assertion depends on real getScreenCTM / getBBox / pointer-event hit testing that the jsdom polyfill returns identity-only stubs for. Currently kept on the exclusion list with the "jointjs paper geometry" comment in tsconfig.spec.json and angular.json.
-
drag-drop.service.spec.ts — 2 specific tests pinned with it.skip and a #4866 comment:
should find 3 input operatorPredicates and 3 output operatorPredicates for an operatorPredicate with 3 input / 3 output ports
should update highlighting, add operator, and add links when an operator is dropped
Both rely on findClosestOperators, which queries SVG geometry. The other 4 tests in this file pass under jsdom and are running.
The earlier-listed monaco-related specs (code-debugger, code-editor, codearea-custom-template, time-travel, versions-list, operator-property-edit-frame) turned out to be blocked by infrastructure issues (CSS import, missing requestIdleCallback, stale TestBed shape), not jsdom layout. They were re-enabled in #4950.
Approach
Add Vitest browser mode via @vitest/browser + Playwright:
yarn add -D @vitest/browser playwright
- Add a separate
vitest.browser.config.ts (or per-target config) that opts in to browser mode and includes only the affected patterns:
test: {
browser: { enabled: true, provider: 'playwright', headless: true, name: 'chromium' },
include: ['**/workflow-editor.component.spec.ts', '**/drag-drop.service.spec.ts'],
}
- Wire a second
gui:test-browser target into angular.json so ng test keeps the fast jsdom default and a dedicated browser-mode run handles these specs.
- Drop
workflow-editor.component.spec.ts from the jsdom exclude lists; flip the 2 drag-drop it.skip back to it.
- CI: add an ubuntu-only job (Playwright on macos/windows runners would multiply minute cost), cache the Playwright binary by version.
Definition of done
workflow-editor.component.spec.ts runs under browser mode with passing assertions.
- The 2 drag-drop
it.skip tests are flipped back to it and pass under browser mode.
- CI runs both default (jsdom) and browser-mode test targets; total wall-clock impact understood.
- Documentation note in
frontend/README.md (or similar) explaining when to use browser mode.
Task Type
Task Summary
Enable Vitest browser mode (Playwright-driven) for the specs that exercise jointjs paper geometry. Right now they run under jsdom with a stub SVG polyfill — enough for jointjs to instantiate, not enough to compute the graph layout the assertions depend on.
Currently affected
workflow-editor.component.spec.ts— entire suite (JointJS Paper+External Module Integration, ~22 tests). Every assertion depends on realgetScreenCTM/getBBox/ pointer-event hit testing that the jsdom polyfill returns identity-only stubs for. Currently kept on the exclusion list with the "jointjs paper geometry" comment intsconfig.spec.jsonandangular.json.drag-drop.service.spec.ts— 2 specific tests pinned withit.skipand a#4866comment:should find 3 input operatorPredicates and 3 output operatorPredicates for an operatorPredicate with 3 input / 3 output portsshould update highlighting, add operator, and add links when an operator is droppedBoth rely on
findClosestOperators, which queries SVG geometry. The other 4 tests in this file pass under jsdom and are running.The earlier-listed monaco-related specs (
code-debugger,code-editor,codearea-custom-template,time-travel,versions-list,operator-property-edit-frame) turned out to be blocked by infrastructure issues (CSS import, missingrequestIdleCallback, stale TestBed shape), not jsdom layout. They were re-enabled in #4950.Approach
Add Vitest browser mode via
@vitest/browser+ Playwright:yarn add -D @vitest/browser playwrightvitest.browser.config.ts(or per-target config) that opts in to browser mode and includes only the affected patterns:gui:test-browsertarget intoangular.jsonsong testkeeps the fast jsdom default and a dedicated browser-mode run handles these specs.workflow-editor.component.spec.tsfrom the jsdom exclude lists; flip the 2 drag-dropit.skipback toit.Definition of done
workflow-editor.component.spec.tsruns under browser mode with passing assertions.it.skiptests are flipped back toitand pass under browser mode.frontend/README.md(or similar) explaining when to use browser mode.Task Type