Skip to content

test(frontend): re-enable 11 result-panel/workspace component specs#4889

Merged
Yicong-Huang merged 5 commits into
apache:mainfrom
Yicong-Huang:fix/reenable-result-panel-specs
May 4, 2026
Merged

test(frontend): re-enable 11 result-panel/workspace component specs#4889
Yicong-Huang merged 5 commits into
apache:mainfrom
Yicong-Huang:fix/reenable-result-panel-specs

Conversation

@Yicong-Huang
Copy link
Copy Markdown
Contributor

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

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] becomes imports: [Comp]. The components are already standalone post-#4873.

Specs re-enabled:

  • result-panel/console-frame
  • result-panel/error-frame
  • result-panel/result-panel
  • result-panel/result-table-frame
  • code-editor-dialog/breakpoint-condition-input
  • power-button/computing-unit-selection
  • property-editor/port-property-edit-frame
  • property-editor/property-editor
  • property-editor/typecasting-display
  • workflow-editor/context-menu
  • workflow-editor/mini-map

The waitForAsync beforeEach wrappers are also rewritten to plain async/await since waitForAsync needs an outer ProxyZone in beforeEach, 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-editordocument.queryCommandSupported and monaco-editor CSS parsing aren't supported by jsdom
  • codearea-custom-template — same monaco-editor CSS parsing issue
  • property-editor/operator-property-edit-frame — formly+nz registers the snippets-o icon dynamically over HTTP, which jsdom rejects
  • workflow-editor/workflow-editor — relies on real getScreenCTM for jointjs paper math, which jsdom returns as null

Any related issues, documentation, discussions?

A slice of #4880.

How was this PR tested?

yarn ng test --watch=false locally:

Test Files  46 passed | 3 skipped (49)
     Tests  216 passed | 8 skipped | 2 todo (226)

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)

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>
@github-actions github-actions Bot added fix frontend Changes related to the frontend GUI labels May 4, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.17%. Comparing base (9f0cfd7) to head (49bb03d).

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     
Flag Coverage Δ
frontend 29.48% <ø> (+<0.01%) ⬆️

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.

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>
@Yicong-Huang Yicong-Huang changed the title chore(frontend): re-enable 4 result-panel component specs chore(frontend): re-enable 11 result-panel/workspace component specs May 4, 2026
@Yicong-Huang Yicong-Huang changed the title chore(frontend): re-enable 11 result-panel/workspace component specs test(frontend): re-enable 11 result-panel/workspace component specs May 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: [...] to imports: [...] for standalone components.
  • Rewrote affected beforeEach(waitForAsync(...)) setups to beforeEach(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.

Yicong-Huang and others added 2 commits May 3, 2026 20:34
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.
@Yicong-Huang Yicong-Huang enabled auto-merge (squash) May 4, 2026 03:48
@Yicong-Huang Yicong-Huang merged commit d14b43d into apache:main May 4, 2026
15 checks passed
@Yicong-Huang Yicong-Huang deleted the fix/reenable-result-panel-specs branch May 4, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants