Skip to content

Recover the hub workflow detail template's coverage by rendering its real children #7534

Closed

Description

@aglinxinyuan

Task Summary

hub-workflow-detail.component.html reports 0 of 46 lines covered while its own .component.ts
sits at 98% with 32 passing tests. That is not an undertested template — it is the attribution loss
recorded in #7458, and this is the file to prove the
mechanism on.

The existing spec stubs the three child components out with
TestBed.overrideComponent(..., { remove: { imports: [...] }, add: { imports: [Stub...] } }). Any
override makes Angular re-JIT the component from its retained decorator metadata; the re-compiled
template function has no source map back to the .html, so every binding still executes and none of
it is attributed.

Measured, on this branch:

Before After
hub-workflow-detail.component.html 0/46 (0.0%) 45/46 (97.8%), branches 3/3
hub-workflow-detail.component.ts 97/99 (98.0%) 97/99 (98.0%)

The remedy is to render the component with its real children in a block that keeps its own
TestBed, so the 32 existing tests keep their mocked WorkflowActionService and the ten assertions
they make on it. Wholesale de-stubbing would mean rewriting those ten assertions, which is a bad
trade.

What the real children need, all of it already available in the repo:

  • workflowEditorTestImports and workflowEditorTestProviders from
    workspace/component/workflow-editor/workflow-editor.test-utils.ts — the latter supplies the real
    WorkflowActionService, which the real editor requires because DynamicSchemaService reads
    getTexeraGraph().getOperatorAddStream(); a mocked service fails at construction.
  • DragDropModule and PanelService for the real mini-map.
  • A MarkdownService stub for the real markdown child's <markdown> element.
  • HubService and WorkflowPersistService stubs matching the shapes the existing mocks use
    (getCounts / postView / isLiked / postLike / postUnlike / cloneWorkflow).

Task Type

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

Activity

  1. added a commit that references this issue on Aug 11, 2026
    dcecfa6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions