Skip to content

test: unit tests for LandingPageComponent#5234

Open
Ma77Ball wants to merge 1 commit into
apache:mainfrom
Ma77Ball:test/landingPageSpec
Open

test: unit tests for LandingPageComponent#5234
Ma77Ball wants to merge 1 commit 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
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

1 participant