Skip to content

test: unit tests for LandingPageComponent#5234

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

test: unit tests for LandingPageComponent#5234
Ma77Ball wants to merge 3 commits into
apache:mainfrom
Ma77Ball:test/landingPageSpec

Conversation

@Ma77Ball
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • Add landing-page.component.spec.ts covering creation, the constructor's userChanged() subscription (login/logout transitions update isLogin and currentUid), ngOnInit calling both getWorkflowCount and loadTops, count population from HubService.getCount, the three top-loved buckets populated by loadTops, the loadTops error path logging via console.error, getTopLovedEntries enriching items via SearchService.extendSearchResultsWithHubActivityInfo(items, true, ["access"]) per action and returning a map keyed by action, and navigateToSearch routing for "workflow", "dataset", and unknown types.
  • Stub HubService, SearchService, WorkflowPersistService, and DatasetService; reuse StubUserService for a real userChanged() subject; replace Router.navigate with a vitest spy.

Any related issues, documentation, or discussions?

Closes: #5225

How was this PR tested?

  • Ran yarn ng test --watch=false --include='src/app/hub/component/landing-page/landing-page.component.spec.ts', 10/10 tests pass.
  • Ran yarn format:fix (1 file formatted, 505 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
@Ma77Ball
Copy link
Copy Markdown
Contributor Author

/request-review @aicam

@github-actions github-actions Bot requested a review from aicam May 26, 2026 21:46
Copy link
Copy Markdown
Contributor

@aicam aicam left a comment

Choose a reason for hiding this comment

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

LGTM!

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.63%. Comparing base (d5bc8b7) to head (5f8bdbc).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5234      +/-   ##
============================================
- Coverage     48.72%   48.63%   -0.10%     
- Complexity     2375     2379       +4     
============================================
  Files          1044     1044              
  Lines         40096    40037      -59     
  Branches       4252     4257       +5     
============================================
- Hits          19538    19471      -67     
- Misses        19411    19415       +4     
- Partials       1147     1151       +4     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø) Carriedforward from 8a7366f
agent-service 33.76% <ø> (ø) Carriedforward from 8a7366f
amber 51.58% <ø> (+0.02%) ⬆️ Carriedforward from 8a7366f
computing-unit-managing-service 0.00% <ø> (ø) Carriedforward from 8a7366f
config-service 0.00% <ø> (ø) Carriedforward from 8a7366f
file-service 37.99% <ø> (ø) Carriedforward from 8a7366f
frontend 40.20% <ø> (+0.17%) ⬆️
python 90.46% <ø> (-0.34%) ⬇️ Carriedforward from 8a7366f
workflow-compiling-service 56.81% <ø> (ø) Carriedforward from 8a7366f

*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.

@aicam aicam added this pull request to the merge queue May 27, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 27, 2026
@Yicong-Huang Yicong-Huang added this pull request to the merge queue May 27, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks May 27, 2026
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 landing-page.component.ts

3 participants