Skip to content

test(frontend): re-enable 4 user-workflow / dashboard / list-item specs#4944

Merged
Yicong-Huang merged 2 commits intoapache:mainfrom
Yicong-Huang:chore/frontend-reenable-nzlist-dashboard-specs
May 6, 2026
Merged

test(frontend): re-enable 4 user-workflow / dashboard / list-item specs#4944
Yicong-Huang merged 2 commits intoapache:mainfrom
Yicong-Huang:chore/frontend-reenable-nzlist-dashboard-specs

Conversation

@Yicong-Huang
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Drop 4 entries from the spec exclusion lists in tsconfig.spec.json and angular.json's test target, port their TestBed setups to the standalone-component shape, and fix one malformed template attribute that jsdom won't tolerate.

Specs re-enabled:

  • dashboard.component.spec.ts — extends socialAuthServiceMock with initState (the Google sign-in directive subscribes to it in its constructor) and adds an AdminSettingsService stub; switches to imports: [DashboardComponent] so its standalone graph carries GoogleSigninButtonModule instead of relying on NO_ERRORS_SCHEMA.
  • user-project-list-item.component.spec.ts — wraps the component in a TestHostComponent template <nz-list><texera-user-project-list-item .../></nz-list> so the <nz-list-item>-rooted component finds an NzListComponent provider; adds provideRouter([]) for the embedded [routerLink].
  • user-workflow-list-item.component.spec.ts — same <nz-list> host wrapper.
  • user-workflow.component.spec.ts — switches declarations: [...] to imports: [...] for the now-standalone children; converts beforeEach(waitForAsync(...)) to beforeEach(async () => ...) so the setup runs outside the per-it ProxyZone wrapper.

Drive-by template fix:

user-workflow.component.html had a stray ]="true" line — left over from #4873's [nzBorderless]="true"nzVariant="borderless" rewrite. Browsers silently tolerate the malformed attribute, but jsdom throws InvalidCharacterError: "]" did not match the Name production during setAttribute, which is why the spec couldn't run under Vitest.

After this PR, the exclude list contains only specs gated on Vitest browser mode (#4866) or specs whose body is still a placeholder.

Any related issues, documentation, discussions?

Part of #4880.

How was this PR tested?

yarn install && yarn ng test --watch=false exits 0 locally; yarn format:ci is clean. CI exercises the same test command on the ubuntu / windows / macos frontend matrices.

Test Files  56 passed | 3 skipped (59)
     Tests  248 passed | 8 skipped | 2 todo (258)

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

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

Lifts the last 4 spec files in apache#4880's NgModule → standalone TestBed
shape. Also fixes a malformed template attribute introduced by the
standalone migration that jsdom would not tolerate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@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.41%. Comparing base (6b79896) to head (2817c1b).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #4944      +/-   ##
============================================
+ Coverage     42.22%   42.41%   +0.19%     
  Complexity     2180     2180              
============================================
  Files           980     1005      +25     
  Lines         36287    37407    +1120     
  Branches       3783     3914     +131     
============================================
+ Hits          15321    15865     +544     
- Misses        20038    20578     +540     
- Partials        928      964      +36     
Flag Coverage Δ
frontend 32.27% <ø> (+1.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 requested a review from aglinxinyuan May 5, 2026 15:01
@Yicong-Huang Yicong-Huang enabled auto-merge (squash) May 5, 2026 23:55
@Yicong-Huang Yicong-Huang merged commit 41a8197 into apache:main May 6, 2026
15 checks passed
@Yicong-Huang Yicong-Huang deleted the chore/frontend-reenable-nzlist-dashboard-specs branch May 6, 2026 00:07
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