Skip to content

test: cover hub.component sidebar gating and routerLinks#5232

Open
Ma77Ball wants to merge 3 commits into
apache:mainfrom
Ma77Ball:test/HubComponentSpec
Open

test: cover hub.component sidebar gating and routerLinks#5232
Ma77Ball wants to merge 3 commits into
apache:mainfrom
Ma77Ball:test/HubComponentSpec

Conversation

@Ma77Ball
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • Replace the hub.component.spec.ts smoke test with nine tests covering default-input render, GuiConfigService injection, per-flag sidebarTabs.*_enabled gating, all-enabled rendering, exclusion of disabled tabs, routerLink bindings to the three routing constants, and isLogin input passthrough.
  • Wrap HubComponent in a test host <ul nz-menu> so nz-menu-item directives resolve their DI tokens the same way they do under the dashboard at runtime.
  • Read routerLink via the directive's routerLinkInput signal since the routerLink input is a write-only setter and ng-reflect-router-link is not populated in the Vitest environment.

Any related issues, documentation, or discussions?

Closes: #5224

How was this PR tested?

  • yarn test --include='src/app/hub/component/hub.component.spec.ts': 9 passed, 0 failed.
  • yarn format:fix: 506 files unchanged.

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

Co-authored with Claude Opus 4.7 in compliance with ASF

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

codecov-commenter commented May 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 45.60%. Comparing base (d5bc8b7) to head (8e345fe).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5232      +/-   ##
============================================
- Coverage     48.72%   45.60%   -3.12%     
+ Complexity     2375     2216     -159     
============================================
  Files          1044     1045       +1     
  Lines         40096    40457     +361     
  Branches       4252     4311      +59     
============================================
- Hits          19538    18452    -1086     
- Misses        19411    20888    +1477     
+ Partials       1147     1117      -30     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø) Carriedforward from bf2f92c
agent-service 33.74% <ø> (-0.03%) ⬇️ Carriedforward from bf2f92c
amber 43.88% <ø> (-7.68%) ⬇️ Carriedforward from bf2f92c
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from bf2f92c
config-service 0.00% <ø> (ø) Carriedforward from bf2f92c
file-service 32.09% <ø> (-5.90%) ⬇️ Carriedforward from bf2f92c
frontend 40.10% <ø> (+0.07%) ⬆️
python 90.50% <ø> (-0.30%) ⬇️ Carriedforward from bf2f92c
workflow-compiling-service 56.81% <ø> (ø) Carriedforward from bf2f92c

*This pull request uses carry forward flags. 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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Ma77Ball
Copy link
Copy Markdown
Contributor Author

/request-review @Yicong-Huang

@github-actions github-actions Bot requested a review from Yicong-Huang May 26, 2026 21:46
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.

Add spec coverage for hub.component.ts

2 participants