Skip to content

test(frontend): cover HubWorkflowDetailComponent#5236

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

test(frontend): cover HubWorkflowDetailComponent#5236
Ma77Ball wants to merge 1 commit into
apache:mainfrom
Ma77Ball:test/hubWorkflowDetailSpec

Conversation

@Ma77Ball
Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

  • Add hub-workflow-detail.component.spec.ts covering constructor wid resolution (NZ_MODAL_DATA vs route), role-based isActivatedUser, and the disableWorkflowModification call.
  • Exercise ngOnInit count/view/isLiked branches including default-to-0, current-user fallback, and the empty-isLiked response case.
  • Cover loadWorkflowWithId (hub vs non-hub fork, success reloads + center event, error path leaves graph untouched), ngOnDestroy → clearWorkflow, goBack success and error, cloneWorkflow early-return and success, toggleLike (short-circuits, like/unlike, refresh, no-op when service returns false), formatCount, and changeViewDisplayStyle.
  • Use Recipe F (overrideComponent remove/add) to swap WorkflowEditorComponent, MiniMapComponent, and MarkdownDescriptionComponent for selector-equivalent stubs so the real template still renders under jsdom.

Any related issues, documentation, or discussions?

Closes: #5227

How was this PR tested?

  • yarn ng test --watch=false --include=src/app/hub/component/workflow/detail/hub-workflow-detail.component.spec.ts (32 passed).

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

Co-authored with Claude Opus 4.7 in compliance with ASF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add spec coverage for hub-workflow-detail.component.ts

1 participant