Yicong-Huang opened a new pull request, #4950:
URL: https://github.com/apache/texera/pull/4950
### What changes were proposed in this PR?
Most specs that #4866 listed as needing Vitest browser mode actually weren't
blocked by jsdom's lack of layout — they were failing earlier, on
infrastructure issues that have nothing to do with browser mode. Fix those root
causes so the specs can run under jsdom, and narrow #4866 to the genuinely
layout-dependent jointjs paper tests.
**Infra fixes:**
- `vitest.config.ts` — inline `monaco-breakpoints` so its `import
'./style.css'` is rewritten by Vite/esbuild instead of crashing Node's ESM
loader with `Unknown file extension ".css"`. This alone unblocks 6 specs from
hard module-load failure.
- `src/jsdom-svg-polyfill.ts` — add `requestIdleCallback` /
`cancelIdleCallback` stubs (Chrome-only API). Used by monaco-related lazy setup.
**Spec migrations** (mechanical leftovers from the standalone migration):
- `code-editor.component.spec.ts`,
`codearea-custom-template.component.spec.ts`, `time-travel.component.spec.ts`,
`versions-list.component.spec.ts`,
`operator-property-edit-frame.component.spec.ts`,
`code-debugger.component.spec.ts` — switch `declarations: [Comp]` to `imports:
[Comp]`; convert `beforeEach(waitForAsync(...))` to `beforeEach(async () =>
...)` so setup runs outside the per-`it` ProxyZone wrapper.
- `code-debugger.component.spec.ts` — `vi.spyOn` calls through by default
(Jasmine's `spyOn` did not). Add `.mockImplementation(() => {})` on the
breakpoint-setup spies so the real implementation doesn't try to construct
`MonacoBreakpoint` over a minimal editor mock.
- `operator-property-edit-frame.component.spec.ts` — replace
`nativeElement.innerText` with `textContent` since jsdom's layout-dependent
`innerText` getter returns `undefined`.
**drag-drop:**
`drag-drop.service.spec.ts` is taken off the exclusion list. Of its 6 tests,
4 don't depend on graph geometry and now pass under jsdom; the 2 that do
(`findClosestOperators` and "update highlighting") are marked `it.skip` with a
comment pointing to #4866. This isolates the truly browser-mode-only assertions.
After this PR, the only spec still excluded for jsdom-vs-real-browser
reasons is `workflow-editor.component.spec.ts` — every test there exercises
jointjs paper geometry, so it stays for #4866 to handle wholesale.
### Any related issues, documentation, discussions?
Part of the Vitest migration umbrella #4861. Narrows #4866 to its real scope
(jointjs paper). The other still-excluded specs are placeholder bodies tracked
separately.
### How was this PR tested?
`yarn install && yarn ng test --watch=false` exits 0 locally; `yarn
format:ci` is clean.
```
Test Files 59 passed | 3 skipped (62)
Tests 251 passed | 11 skipped | 2 todo (264)
```
### Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.7 (1M context)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]