Skip to content

test(frontend): close the branch arms left in the dataset explorer components - #7833

Merged
aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:cov/dataset-explorer-branches
Aug 22, 2026
Merged

aglinxinyuan merged 1 commit into
apache:mainfrom
aglinxinyuan:cov/dataset-explorer-branches

Conversation

@aglinxinyuan

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Test-only. No production file changes.

Both templates here reached 100% in merged PRs #7681 and #7772, which lifted these .ts files as a side effect — so what remained was branch arms and uncalled handlers rather than whole untested regions. Measured with istanbul JSON from --coverage --coverage-reporters=json, one spec at a time, identical --include filter for the before and after runs:

dataset-detail.component.ts

before after
statements 425/430 (98.84%) 428/430 (99.53%)
branch arms 177/203 (87.19%) 193/203 (95.07%)
functions 115/120 (95.83%) 120/120 (100%)

In the Codecov framing used in the issue: 5 missed lines + 24 partial → 2 missed + 9 partial. 15 of the 24 partial lines are now fully covered. Closed 3 of 5 missed statement lines, 16 of 26 missed branch arms, and 5 of 5 missed functions. Its template is re-confirmed at 455/455 statements and 46/46 branch arms, so nothing was added there.

user-dataset-version-creator.component.ts

before after
statements 58/63 (92.06%) 62/63 (98.41%)
branch arms 22/24 (91.67%) 24/24 (100%)
functions 14/16 (87.50%) 15/16 (93.75%)

Codecov framing: 5 missed + 2 partial → 1 missed + 0 partial.

Tests 188 → 214: dataset-detail 173 → 192, version-creator 15 → 18, plus the repair round below.

An honest correction to the second target's count

The assessment called it 5 lines + 2 arms. The real closable count is 4 statements + 2 arms + 1 function, because one of its 5 missed lines is dead code: get formControlNames(): string[]. A repo-wide grep returns exactly one hit — its own declaration — with no template and no TypeScript reference. It is left uncovered deliberately rather than cemented; deleting the getter belongs in a separate production PR.

Verification

Review raised 14 findings across two lenses; the repair round took the suite to 214 and every accepted finding was proved by running the reviewer's proposed mutation first, then re-running after the fix to confirm it dies on the named test.

Neither file is an instance of #7458 — no TestBed.overrideComponent in either spec, which the non-zero starting percentages already implied.

One earlier misdiagnosis was deliberately not re-reported: dataset-detail.component.html:593's [disabled] binding does work. NgModel routes it through control.disable(), deferred to a microtask, so the DOM lags one turn behind detectChanges() — asserting immediately reads a stale value and looks like an inert binding.

Any related issues, documentation, discussions?

Closes #7832

How was this PR tested?

npx ng test --watch=false --include="**/dataset-detail.component.spec.ts" --include="**/user-dataset-version-creator.component.spec.ts"
 Test Files  2 passed (2)
      Tests  214 passed (214)

yarn format:ci exits 0; no junit.xml left behind.

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

Generated-by: Claude Code (Opus 5)

Copilot AI lite review requested due to automatic review settings August 22, 2026 07:29

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

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.55%. Comparing base (2edbdf9) to head (3f870b8).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #7833      +/-   ##
============================================
+ Coverage     91.50%   91.55%   +0.04%     
  Complexity     4501     4501              
============================================
  Files          1177     1175       -2     
  Lines         47489    47368     -121     
  Branches       5324     5310      -14     
============================================
- Hits          43457    43366      -91     
+ Misses         2366     2355      -11     
+ Partials       1666     1647      -19     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from 2edbdf9
agent-service 98.62% <ø> (ø) Carriedforward from 2edbdf9
amber 88.04% <ø> (ø) Carriedforward from 2edbdf9
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from 2edbdf9
config-service 86.73% <ø> (ø) Carriedforward from 2edbdf9
file-service 75.74% <ø> (ø) Carriedforward from 2edbdf9
frontend 93.34% <ø> (+0.10%) ⬆️
notebook-migration-service 79.13% <ø> (ø) Carriedforward from 2edbdf9
pyamber 97.57% <ø> (ø) Carriedforward from 2edbdf9
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from 2edbdf9

*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 2 out of 2 changed files in this pull request and generated no new comments.

Suppressed comments (1)

frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.spec.ts:404

  • Passing vi.fn() here bypasses the real re-drop path this test claims to cover. onNewUploadFilesChanged passes continueWithUpload as this callback; that callback calls cancelExistingUpload again while the original task is still "initializing" (the task is marked "aborted" only after the callback), so a real re-drop can recurse instead of starting a replacement. Please drive onNewUploadFilesChanged([makeFileItem("b.txt")]) and assert that the replacement starts and the old task is aborted.
      const onCanceled = vi.fn();

      component.cancelExistingUpload("b.txt", onCanceled);

@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

@aglinxinyuan
aglinxinyuan added this pull request to the merge queue Aug 22, 2026
Merged via the queue into apache:main with commit 489b832 Aug 22, 2026
25 checks passed
@aglinxinyuan
aglinxinyuan deleted the cov/dataset-explorer-branches branch August 22, 2026 08:26
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.

Close the branch arms left in the dataset explorer components

4 participants