mengw15 opened a new issue, #7686:
URL: https://github.com/apache/texera/issues/7686

   ### Task Summary
   
   Four more frontend files sit a few untaken **branches** from full coverage — 
23 partial branches and 10 unhit lines between them, worth roughly **+10.0pp / 
+7.5pp / +7.0pp / +6.7pp** on the respective files. Codecov computes `coverage 
= hits / lines` and does not count a partially-covered line as a hit, so each 
missing branch costs real percentage points.
   
   **Goal: take the missing side of each conditional so these files reach full 
coverage.** All four already have a spec; extend it and re-run the coverage 
report to confirm the partials cleared. Vitest/jsdom; see 
`frontend/TESTING.md`. Every case below is a plain input variation — no timers, 
clock, randomness, or layout involved.
   
   ### Behavior to add
   
   **DatasetSelectionModalComponent** 
(`frontend/src/app/workspace/component/dataset-selection-modal/dataset-selection-modal.component.ts`,
 90.0%, 4 partials)
   - `if (this.selectedDataset?.dataset.did !== undefined)` (two sites, the 
second also `&& this.selectedVersion?…`) — drive the modal with no dataset 
selected, with a dataset whose `did` is set, and with a dataset selected but no 
version, so each side of the guard runs.
   - `if (this.data.fileMode)` (two sites) — open the modal with `fileMode` 
true and false via `NZ_MODAL_DATA`, asserting the different confirm payload 
each produces.
   
   **UdfDebugService** 
(`frontend/src/app/workspace/service/operator-debug/udf-debug.service.ts`, 
89.2%, 7 partials + 3 unhit)
   - `if (isDefined(breakpointInfo))` — a breakpoint that exists and one that 
does not.
   - `if (!isDefined(lineNum)) return` (two sites, L184 and L217) — call with a 
line number and without; the unhit `return` lines are those early exits.
   - `if (isDefined(breakpointId) && isDefined(lineNum))` — cover each half of 
the `&&` being undefined as well as both defined.
   - `if (!debugState.has(String(lineNum)))` — a line that has debug state and 
one that does not (the second is the other unhit `return`).
   - The unhit `return {}` — the accessor's empty-state arm (no debug state for 
the operator).
   
   **HubWorkflowDetailComponent** 
(`frontend/src/app/hub/component/workflow/detail/hub-workflow-detail.component.ts`,
 91.0%, 7 partials + 2 unhit)
   - `workflowDescription || "No description available"` — a workflow with a 
description and one with an empty description, asserting the placeholder text 
renders.
   - `if (success)` — make the action service double report success and failure.
   - `if (!isDefined(this.wid))` — drive it with the workflow id absent so the 
unhit `return` runs, and with it present.
   - `counts[0].counts.like ?? 0` — a counts payload that carries `like` and 
one where it is null/absent.
   - The second unhit `return` is the matching early exit on that path.
   
   **UserDatasetComponent** 
(`frontend/src/app/dashboard/component/user/user-dataset/user-dataset.component.ts`,
 86.7%, 5 partials + 5 unhit)
   - `if (this._searchResultsComponent)` and `if (this._filters)` — access each 
accessor **before** the view child is assigned so the unhit `throw new 
Error("Property cannot be accessed before it is initialized.")` lines run, and 
after assignment for the happy arm.
   - `this.masterFilterList !== null && …` — cover the null and non-null master 
filter list.
   - `if (!forced && sameList && this.sortMethod === this.lastSortMethod)` — 
vary one condition at a time (forced refresh, a changed filter list, a changed 
sort method) so each half of the conjunction is exercised, plus the all-true 
early-return case.
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [x] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to