Skip to content

test(frontend): render the hub workflow detail with its real children - #7535

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:cov/hub-detail-destub
Aug 11, 2026
Merged

test(frontend): render the hub workflow detail with its real children#7535
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:cov/hub-detail-destub

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

hub-workflow-detail.component.html reported 0 of 46 lines while its own .ts sat at 98% — the
attribution loss from #7458, not a testing gap. The spec stubs its three children out through
TestBed.overrideComponent, and any override re-JITs the component from its decorator metadata; the
re-compiled template has no source map back to the .html, so the bindings execute uncounted.

Adds a describe block that renders the component with its real children. That restores
attribution:

Before After
lines 0/46 (0.0%) 45/46 (97.8%)
branches 3/3

Three tests: the real editor and mini-map resolving rather than the stub selectors, and the
*ngIf="isHub" back button appearing and not appearing. It keeps its own TestBed so the 32 tests
above retain their mocked WorkflowActionService and the ten assertions they make on it — the real
service is needed here only because the real editor injects DynamicSchemaService, which reads the
graph's operator streams.

Verification

Both *ngIf mutations were applied to the template and reverted (production diff empty):

Mutation Result
back button always rendered (*ngIf="true") red
back button never rendered (*ngIf="false") red

Two assertions in the first test are honestly guards, not behaviour pins: renaming the child
elements only breaks the template build rather than producing a clean behavioural failure, so they
are there to stop the override creeping back in, and the coverage measurement above is their real
evidence. Saying so rather than listing them as killed mutations.

One assertion was dropped during review of my own work: the clone button's
[disabled]="!isLogin || !isHub || !isActivatedUser" does not reflect to the DOM disabled
property under this fixture (it stays false with isHub === false), so asserting on it would have
been either vacuous or wrong. The back button discriminates cleanly and is what the tests use.

No production file is touched.

Any related issues, documentation, discussions?

Closes #7534

How was this PR tested?

npx ng test --watch=false --include="**/hub-workflow-detail.component.spec.ts"
 Test Files  1 passed (1)
      Tests  35 passed (35)

3 new on top of the existing 32. yarn format:ci passes.

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

Generated-by: Claude Code (Opus 5)

hub-workflow-detail.component.html reported 0 of 46 lines covered while
its own .ts sat at 98%, which is not an undertested template - it is the
attribution loss recorded in apache#7458. The existing spec stubs the three
child components out through TestBed.overrideComponent, and any override
makes Angular re-JIT the component from its retained decorator metadata;
the re-compiled template has no source map back to the .html, so every
binding still executes and none is counted.

Adds a describe block that renders the component with its real children,
which restores attribution: the template goes from 0/46 to 45/46 lines
and 3/3 branches. It keeps its own TestBed so the 32 tests above retain
their mocked WorkflowActionService and the ten assertions they make on
it; the real service is needed here only because the real editor injects
DynamicSchemaService, which reads the graph's operator streams.

No production file is touched.
Copilot AI lite review requested due to automatic review settings August 11, 2026 05:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Aug 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Ma77Ball
    You can notify them by mentioning @Ma77Ball in a comment.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.52%. Comparing base (561cd0e) to head (99b8056).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7535      +/-   ##
============================================
+ Coverage     87.42%   87.52%   +0.10%     
  Complexity     4253     4253              
============================================
  Files          1176     1176              
  Lines         46986    46986              
  Branches       5245     5245              
============================================
+ Hits          41077    41126      +49     
+ Misses         4178     4131      -47     
+ Partials       1731     1729       -2     
Flag Coverage Δ *Carryforward flag
access-control-service 70.00% <ø> (ø) Carriedforward from 561cd0e
agent-service 98.62% <ø> (ø) Carriedforward from 561cd0e
amber 82.20% <ø> (ø) Carriedforward from 561cd0e
computing-unit-managing-service 60.38% <ø> (ø) Carriedforward from 561cd0e
config-service 65.97% <ø> (ø) Carriedforward from 561cd0e
file-service 69.05% <ø> (ø) Carriedforward from 561cd0e
frontend 89.70% <ø> (+0.23%) ⬆️
notebook-migration-service 78.89% <ø> (ø) Carriedforward from 561cd0e
pyamber 97.52% <ø> (ø) Carriedforward from 561cd0e
workflow-compiling-service 26.31% <ø> (ø) Carriedforward from 561cd0e

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aglinxinyuan
aglinxinyuan requested a review from mengw15 August 11, 2026 05:27

@mengw15 mengw15 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

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

4 participants