Skip to content

test(frontend): cover the time-travel poller and the feedback component - #7992

Open
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:cov/time-travel-and-feedback
Open

test(frontend): cover the time-travel poller and the feedback component#7992
aglinxinyuan wants to merge 1 commit into
apache:mainfrom
aglinxinyuan:cov/time-travel-and-feedback

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Three small frontend components, measured from lcov with the same spec filter on both sides.

File Codecov lcov detail
time-travel.component.ts 92.3% → 100% branches 20/22 → 22/22; functions 17/18 → 18/18
feedback.component.ts 85.2% → 100% branches 14/17 → 17/17; functions 8/11 → 11/11
feedback.component.html 83.3% → 100% branches 2/4 → 4/4; functions 0/2 → 2/2
repeat-dnd.component.html 86.4% → 95.5% one arm left deliberately — see below
repeat-dnd.component.ts (incidental) 90.9% → 100% branches 17/18 → 18/18

+14 fully-covered lines, +9 branch arms, +7 functions.

The template's function counter is the one to notice: feedback.component.html was at zero of two functions covered behind an 83% line figure. That is the fifth time in this campaign the function counter found what the line counter hid. time-travel.component.ts's zero-hit lines 84-88 were the entire ngOnInit timer lambda body.

port-property-edit-frame.component.ts was in scope and is absent. It is worth exactly zero: two of its three residual lines are dead Quill config and the third is unreachable in practice. No tests were added there and no mutations run.

A production defect found while assessing it

Chasing those two Quill lines turned up a real bug rather than coverage: the port-name editor's keyboard bindings use key: 13, which is Quill 1 syntax that Quill 2 never dispatches. So pressing Enter in the port-name editor inserts a newline into the shared display name instead of closing the editor. Reported, not pinned — pinning current behaviour would cement it.

One arm left uncovered on purpose

repeat-dnd.component.html line 48 is the remove button's [disabled]="field.templateOptions?.disabled", and issue #7431 records that the enclosing *ngFor shadows the outer field, so it never disables. That arm is deliberately not pinned. The assertion added in that spec is on the add button, and it carries a comment explaining why an absent templateOptions object must not read as disabled.

Verification

28 mutations, 24 killed, 4 recorded.

The first draft's headline was false: it claimed "survivors: NONE, every one of the 14 new tests proven by a mutation actually applied and run". Eight mutants survived it — seven found by review plus one found here (deleting an [nzLoading] binding). All eight now die.

Its survivor-to-mutation mapping was also wrong in one place: two separate mutations had been given the same number, so a kill was credited to the wrong row.

The four recorded non-kills are: the #7431 arm above (refused), an equivalent mutant ([nzData]="[...feedbackList]"[nzData]="feedbackList" — the spread produces an equal array), and two entries covering port-property-edit-frame, where no tests were added.

One further correction worth making: feedback.component.html reaching 24/24 is not a quality claim on its own. At 24/24 the file is fully executed; what makes it constrained is the mutations, not the percentage.

No production file is touched. The worktree used a real yarn install rather than a node_modules junction.

Any related issues, documentation, discussions?

Closes #7990

How was this PR tested?

npx ng test --watch=false --include="**/time-travel.component.spec.ts" --include="**/feedback.component.spec.ts" --include="**/repeat-dnd.component.spec.ts"
 Test Files  3 passed (3)

yarn format:ci passes. frontend/junit.xml and frontend/coverage/ are regenerated by every run and are not committed.

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

Generated-by: Claude Code (Opus 5)

+14 fully-covered lines, +9 branch arms, +7 functions. time-travel and both
feedback files reach 100%; repeat-dnd goes 86.4% to 95.5%.

feedback.component.html had ZERO of its two functions covered behind an 83%
line figure -- the fifth time this campaign the function counter found what
the line counter hid. time-travel's zero-hit lines were the whole ngOnInit
timer lambda body.

port-property-edit-frame was in scope and is absent, worth exactly zero: two
of its three residual lines are dead Quill config. Chasing them found a real
bug instead, reported not pinned -- the port-name editor's `key: 13` bindings
are Quill 1 syntax that Quill 2 never dispatches, so Enter inserts a newline
into the shared display name instead of closing the editor.

repeat-dnd line 48 is left uncovered deliberately: it is the remove button's
disabled binding, and issue apache#7431 records that the enclosing ngFor shadows
`field` so it never disables. The assertion added there is on the add button.

28 mutations, 24 killed. The first pass claimed no survivors while eight
were alive, and had two mutations sharing one number, so a kill was credited
to the wrong row.
Copilot AI lite review requested due to automatic review settings August 26, 2026 08:51

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

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: @aicam, @mengw15
    You can notify them by mentioning @aicam, @mengw15 in a comment.

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

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.24%. Comparing base (5de9bf9) to head (57d4dcf).

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7992      +/-   ##
============================================
+ Coverage     93.21%   93.24%   +0.03%     
  Complexity     4664     4664              
============================================
  Files          1175     1175              
  Lines         47646    47646              
  Branches       5319     5319              
============================================
+ Hits          44413    44428      +15     
+ Misses         1752     1739      -13     
+ Partials       1481     1479       -2     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from 5de9bf9
agent-service 99.32% <ø> (ø) Carriedforward from 5de9bf9
amber 89.31% <ø> (ø) Carriedforward from 5de9bf9
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from 5de9bf9
config-service 86.73% <ø> (ø) Carriedforward from 5de9bf9
file-service 86.70% <ø> (ø) Carriedforward from 5de9bf9
frontend 95.74% <ø> (+0.07%) ⬆️
notebook-migration-service 79.31% <ø> (ø) Carriedforward from 5de9bf9
pyamber 97.74% <ø> (ø) Carriedforward from 5de9bf9
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from 5de9bf9

*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.

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 3 out of 3 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

frontend/src/app/workspace/component/left-panel/time-travel/time-travel.component.spec.ts:279

  • Same double-destroy risk here: this calls fixture.destroy() inside the test and again in afterEach. Prefer component.ngOnDestroy() here to release the timer subscription within fakeAsync, leaving fixture teardown centralized in afterEach.
      fixture.destroy();

frontend/src/app/workspace/component/left-panel/time-travel/time-travel.component.spec.ts:290

  • Calling fixture.destroy() here duplicates the suite afterEach teardown and may raise a double-destroy exception. To simulate component teardown for the poller without destroying the fixture twice, call component.ngOnDestroy() here instead (it triggers @UntilDestroy cleanup) and keep the final fixture teardown in afterEach.
      fixture.destroy();

expect(widSpy).toHaveBeenCalledTimes(1);
expect(displaySpy).not.toHaveBeenCalled();

fixture.destroy();

@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.

Cover the time-travel poller and the feedback component

4 participants