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
Task Summary
Create landing-page.component.spec.ts for frontend/src/app/hub/component/landing-page/landing-page.component.ts.
Behavior to cover:
Task Type