test(frontend): re-enable 11 result-panel/workspace component specs#4889
Conversation
Migrate the result-panel TestBed setups to standalone-component shape: console-frame, error-frame, result-panel, result-table-frame. The `waitForAsync` `beforeEach` wrappers are also rewritten to plain `async/await` so they no longer need an outer ProxyZone. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4889 +/- ##
============================================
- Coverage 43.21% 42.17% -1.05%
+ Complexity 2154 2153 -1
============================================
Files 915 954 +39
Lines 32208 34694 +2486
Branches 3256 3629 +373
============================================
+ Hits 13918 14631 +713
- Misses 17446 19159 +1713
- Partials 844 904 +60
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Migrate the following TestBed setups to standalone-component shape and drop the entries from the exclusion lists: - workspace/code-editor-dialog/breakpoint-condition-input - workspace/power-button/computing-unit-selection - workspace/property-editor/port-property-edit-frame - workspace/property-editor/property-editor - workspace/property-editor/typecasting-display - workspace/workflow-editor/context-menu - workspace/workflow-editor/mini-map The five remaining workspace specs with monaco-editor or jointjs dependencies (code-debugger, code-editor, codearea-custom-template, operator-property-edit-frame, workflow-editor) still hit jsdom limitations and are kept on the exclude list with the specific reason inline, to be addressed once Vitest browser mode (apache#4866) lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Re-enables a set of previously-excluded Angular workspace/result-panel component specs by updating their TestBed configuration to the standalone-component pattern, and updates async setup to avoid waitForAsync dependency on ProxyZone.
Changes:
- Removed 11 spec files from the frontend unit-test exclusion lists (
tsconfig.spec.json+angular.json). - Migrated the 11 specs’ TestBed setup from
declarations: [...]toimports: [...]for standalone components. - Rewrote affected
beforeEach(waitForAsync(...))setups tobeforeEach(async () => { ... await ... }).
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/tsconfig.spec.json | Drops 11 specs from the exclude list; adds/adjusts inline comments for remaining jsdom-limited specs. |
| frontend/angular.json | Drops the same 11 specs from the Angular unit-test builder exclude list. |
| frontend/src/app/workspace/component/workflow-editor/mini-map/mini-map.component.spec.ts | Updates TestBed to import standalone components and uses async/await setup. |
| frontend/src/app/workspace/component/workflow-editor/context-menu/context-menu/context-menu.component.spec.ts | Moves ContextMenuComponent from declarations to imports in TestBed. |
| frontend/src/app/workspace/component/result-panel/result-table-frame/result-table-frame.component.spec.ts | Uses standalone import pattern and async/await compilation. |
| frontend/src/app/workspace/component/result-panel/result-panel.component.spec.ts | Uses standalone import pattern and async/await compilation. |
| frontend/src/app/workspace/component/result-panel/error-frame/error-frame.component.spec.ts | Uses standalone import pattern and async/await compilation. |
| frontend/src/app/workspace/component/result-panel/console-frame/console-frame.component.spec.ts | Uses standalone import pattern and async/await compilation. |
| frontend/src/app/workspace/component/property-editor/typecasting-display/type-casting-display.component.spec.ts | Uses standalone import pattern and async/await compilation. |
| frontend/src/app/workspace/component/property-editor/property-editor.component.spec.ts | Uses standalone import pattern and async/await compilation (with overrideComponent). |
| frontend/src/app/workspace/component/property-editor/port-property-edit-frame/port-property-edit-frame.component.spec.ts | Uses standalone import pattern and async/await compilation. |
| frontend/src/app/workspace/component/power-button/computing-unit-selection.component.spec.ts | Uses standalone import pattern (component imported instead of declared). |
| frontend/src/app/workspace/component/code-editor-dialog/breakpoint-condition-input/breakpoint-condition-input.component.spec.ts | Uses standalone import pattern for the component in TestBed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CI on PR apache#4889 surfaced unhandled `IconNotFoundError` / xhr-utils `AggregateError` exceptions originating in NgZorro's `NzIconService`: when an icon isn't pre-registered the service falls back to a dynamic HTTP fetch from `/assets/...`, which jsdom rejects. Specs aren't asserting on icon rendering, but Vitest treats the unhandled errors as non-zero exit. Stubbing every spec with `NzIconModule.forChild([...])` for every icon its template uses is impractical. Add a process-level `uncaughtException` / `unhandledRejection` filter that swallows those two specific patterns and re-raises everything else. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…drop unused import - error-frame.component.spec.ts: rename the describe block from "ConsoleFrameComponent" to "ErrorFrameComponent" so test output and failure messages match the component under test. - context-menu.component.spec.ts: replace HttpClientModule with HttpClientTestingModule (both at the import site and inside the TestBed imports array) so the unit test cannot accidentally reach a real HTTP backend. - mini-map.component.spec.ts: drop the unused WorkflowEditorComponent TestBed import; the spec only constructs MiniMapComponent.
What changes were proposed in this PR?
Drop 11 spec files from the exclusion lists and migrate their TestBed setups to the standalone-component shape —
declarations: [Comp]becomesimports: [Comp]. The components are already standalone post-#4873.Specs re-enabled:
result-panel/console-frameresult-panel/error-frameresult-panel/result-panelresult-panel/result-table-framecode-editor-dialog/breakpoint-condition-inputpower-button/computing-unit-selectionproperty-editor/port-property-edit-frameproperty-editor/property-editorproperty-editor/typecasting-displayworkflow-editor/context-menuworkflow-editor/mini-mapThe
waitForAsyncbeforeEachwrappers are also rewritten to plainasync/awaitsincewaitForAsyncneeds an outer ProxyZone inbeforeEach, which the unit-test builder doesn't install.Specs that did NOT make it into this PR
Five workspace specs hit jsdom limitations beyond a TestBed migration and remain in the exclude list with an inline comment explaining the reason — to be picked up once Vitest browser mode (#4866) lands:
code-editor-dialog/code-debugger&code-editor—document.queryCommandSupportedand monaco-editor CSS parsing aren't supported by jsdomcodearea-custom-template— same monaco-editor CSS parsing issueproperty-editor/operator-property-edit-frame— formly+nz registers thesnippets-oicon dynamically over HTTP, which jsdom rejectsworkflow-editor/workflow-editor— relies on realgetScreenCTMfor jointjs paper math, which jsdom returns as nullAny related issues, documentation, discussions?
A slice of #4880.
How was this PR tested?
yarn ng test --watch=falselocally:Up from 35 / 182 on main.
Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 4.7 (1M context)