Skip to content

test(frontend): unblock 7 specs from jsdom#4950

Merged
Yicong-Huang merged 2 commits intoapache:mainfrom
Yicong-Huang:chore/frontend-jsdom-runnable-specs
May 6, 2026
Merged

test(frontend): unblock 7 specs from jsdom#4950
Yicong-Huang merged 2 commits intoapache:mainfrom
Yicong-Huang:chore/frontend-jsdom-runnable-specs

Conversation

@Yicong-Huang
Copy link
Copy Markdown
Contributor

@Yicong-Huang Yicong-Huang commented May 5, 2026

What changes were proposed in this PR?

Most specs that #4866 listed as needing Vitest browser mode actually weren't blocked by jsdom's missing layout — they were tripping on infra and migration leftovers. Fix the root causes so they run under jsdom; narrow #4866 to the real layout-dependent jointjs paper suite.

Three changes:

  • vitest.config.ts inlines monaco-breakpoints so its import './style.css' goes through Vite instead of Node's ESM loader (which crashes on .css).
  • jsdom-svg-polyfill.ts stubs requestIdleCallback (Chrome-only).
  • 6 specs get declarationsimports (post-refactor(frontend): convert all components to standalone #4873 standalone) and beforeEach(waitForAsync)beforeEach(async) (the ProxyZone wrapper in test-zone-setup.ts only covers it/test).

Plus three small per-spec fixes: vi.spyOn.mockImplementation(() => {}) in code-debugger (vitest spies call through by default, unlike Jasmine), innerTexttextContent in operator-property-edit-frame (jsdom's innerText is layout-dependent), and it.skip for the 2 drag-drop tests that genuinely need real geometry.

After this, the only spec excluded for jsdom-vs-real-browser reasons is workflow-editor.component.spec.ts.

Any related issues, documentation, discussions?

Part of #4861. Narrows #4866 to the jointjs paper suite + 2 drag-drop geometry tests.

How was this PR tested?

yarn ng test --watch=false: 251 pass, 11 skip, 2 todo. yarn format:ci clean.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Opus 4.7 (1M context)

@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label May 5, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.58%. Comparing base (34b004d) to head (7597811).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4950      +/-   ##
============================================
+ Coverage     42.49%   42.58%   +0.09%     
  Complexity     2177     2177              
============================================
  Files          1005     1031      +26     
  Lines         37422    38096     +674     
  Branches       3911     3997      +86     
============================================
+ Hits          15901    16223     +322     
- Misses        20558    20861     +303     
- Partials        963     1012      +49     
Flag Coverage Δ
frontend 33.00% <ø> (+0.73%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Yicong-Huang Yicong-Huang changed the title test(frontend): unblock 7 specs from jsdom; narrow #4866 to jointjs paper test(frontend): unblock 7 specs from jsdom May 5, 2026
@Yicong-Huang Yicong-Huang requested a review from aglinxinyuan May 5, 2026 18:23
@Yicong-Huang Yicong-Huang enabled auto-merge (squash) May 5, 2026 23:53
…ntjs paper

Most of the specs previously parked under apache#4866 didn't actually need
Vitest browser mode — they were tripping over a CSS import in
monaco-breakpoints, missing requestIdleCallback in jsdom, and stale
NgModule TestBed setups. Address those root causes so the specs can
run under jsdom; leave only the genuinely layout-dependent jointjs
paper tests for browser mode.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Yicong-Huang Yicong-Huang merged commit 933f7fe into apache:main May 6, 2026
15 checks passed
@Yicong-Huang Yicong-Huang deleted the chore/frontend-jsdom-runnable-specs branch May 6, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants