Skip to content

Add spec coverage for landing-page.component.ts #5225

@Ma77Ball

Description

@Ma77Ball

Task Summary

Create landing-page.component.spec.ts for frontend/src/app/hub/component/landing-page/landing-page.component.ts.

Behavior to cover:

  • Constructor — subscribes to UserService.userChanged(); on emission updates isLogin and currentUid.
  • ngOnInit — calls getWorkflowCount() and loadTops().
  • getWorkflowCount — calls HubService.getCount(EntityType.Workflow) and HubService.getCount(EntityType.Dataset) and assigns to workflowCount / datasetCount.
  • loadTops — awaits Promise.all of getTopLovedEntries for Workflow [Like, Clone] and Dataset [Like]; assigns topLovedWorkflows, topClonedWorkflows, topLovedDatasets; logs and swallows errors via console.error.
  • getTopLovedEntries — calls HubService.getTops, then for each requested action type extends the items via SearchService.extendSearchResultsWithHubActivityInfo(items, true, ["access"]); returns map keyed by action.
  • navigateToSearch — routes to DASHBOARD_HUB_WORKFLOW_RESULT for "workflow", DASHBOARD_HUB_DATASET_RESULT for "dataset", and DASHBOARD_HOME for unknown types.

Task Type

  • Refactor / Cleanup
  • DevOps / Deployment / CI
  • Testing / QA
  • Documentation
  • Performance
  • Other

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions