mengw15 opened a new pull request, #7877:
URL: https://github.com/apache/texera/pull/7877

   ### What changes were proposed in this PR?
   
   15 new tests take the missing arm of the branches #7849 lists, moving the 
three files from
   294/317 branches to 309/317 and closing the one unreached line.
   
   | file | statements | branches |
   | --- | --- | --- |
   | `hugging-face.component.ts` | 295/295 | 127/134 -> 130/134 |
   | `workflow-action.service.ts` | 300/300 | 66/75 -> 72/75 |
   | `shared-model-change-handler.ts` | 198/199 -> **199/199** | 101/108 -> 
107/108 |
   
   **SharedModelChangeHandler** — a delete arriving from another client (the 
local-only
   unhighlight is skipped, the removal is not); a position update that carries 
no value; display
   name and property changes on an **output** port, which take the other side 
of the `isInput`
   ternaries; a property change carrying only one half of the 
partition/dependency pair, which
   must stay silent; removing a port from a side that has none; and the 
defensive
   `throw new Error("undefined port operation …")`, reached by handing the 
handler an event whose
   path is neither the add/delete shape nor a property path — Yjs cannot 
produce one through the
   graph API, so that one call goes in directly.
   
   **WorkflowActionService** — `addOperatorsAndLinks` with neither links nor 
comment boxes;
   enabling modification while it is already enabled (which must not 
re-announce it); a
   three-operator layout where the x and y comparisons each decide the result 
in both directions;
   and `setTempWorkflow` with the shared-editing provider both meant to connect 
and not.
   
   **HuggingFaceComponent** — a teardown with no pending init timeout; the 
fallback to the last
   selected task when the form carries none; and restoring a snapshot that does 
not carry every
   task-scoped key.
   
   No production code was changed.
   
   ### The 8 arms left
   
   Five cannot be reached at all:
   
   - **`workflow-action.service.ts:372`, `:379` and `:872`** — all three read
     `elementPositionMap.get(id) !== newPosition`, and `getElementPosition()` 
returns a fresh
     `{ x, y }` on every call, so the comparison is between two distinct 
objects and is always
     true. The "position unchanged, skip the write" guard these three implement 
therefore never
     fires — worth a look on its own; a value comparison would make it real 
(and give the arm
     something to take).
   - **`hugging-face.component.ts:636`** — `defaults[key] ?? ""`. The 
`defaults` literal supplies
     every one of the twelve `taskScopedKeys`, and `??` does not fall back on 
`""`, so the
     fallback is dead.
   - **`shared-model-change-handler.ts:376`** — needs a port delta that is 
neither an insert nor
     a delete; the graph API cannot produce one.
   
   Three are reachable but only by waiting on a real timer, which this repo's 
specs avoid and the
   issue's own determinism note rules out:
   
   - **`hugging-face.component.ts:181`** — the `??` inside the `setTimeout(…, 
0)` that `ngOnInit`
     schedules.
   - **`hugging-face.component.ts:235` and `:347`** — the `else if` arms in the 
task and model
     polling loops, which need a fetch to be cancelled while a poll is in 
flight.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7849.
   
   ### How was this PR tested?
   
   `ng test --watch=false` over the three specs — 187 passed (172 existing + 15 
new), run 3x for
   determinism. Coverage (`--coverage`) gives the table above. The failure path 
was verified by
   breaking one assertion in two of the specs (red, non-zero exit) and 
restoring them.
   `yarn --cwd frontend format:ci`, the repo's own lint step, is clean.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 4.8 [1M context])
   


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