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

   ### What changes were proposed in this PR?
   
   `joint-graph-wrapper.ts` sat at 76.4% lines and **50.6% branches**. The 
branch number is the one
   that mattered — half its conditions had only ever been taken one way.
   
   Adds 20 tests to the existing spec, appended as new blocks rather than edits 
so a rebase stays
   cheap (#6489 also touches this file). Covered: absolute positioning, the 
link-cell change stream,
   auto layout, the co-editor presence rings including re-padding when one is 
deleted, the editing
   banner, and the guard clauses for missing and wrong-typed cells.
   
   | | Before | After |
   |---|---|---|
   | Lines | 220/288 (76.4%) | **282/288 (97.91%)** |
   | Branches | 43/85 (50.6%) | **82/85 (96.47%)** |
   | Functions | 98/111 (88.3%) | 107/111 (96.39%) |
   
   ### Verification
   
   46 mutations were applied and reverted, 45 red on the first pass. One 
survived — the
   `currentStrokeIds.includes(highlightIdToDelete)` guard — and the test was 
strengthened to assert
   ring **order** after a ghost delete, which kills it.
   
   Review then found two more problems, both fixed:
   
   - **A test whose name outran its assertions.** `"removeCurrentEditing hides 
the banner and stops
     the animation"` could not fail on the second half: `removeCurrentEditing` 
blanks the banner text
     first, so the interval body's ownership check is permanently false and 
advancing the timers is a
     no-op whether or not the interval was cleared. `clearInterval` is already 
pinned by a
     pre-existing test, so the unfalsifiable half was removed rather than 
propped up.
   - **A comment that misdescribed its own branch.** It claimed a link 
exercised the `|| 0` fallback in
     `getCellLayer`; a link's `z` is explicitly 0, so it only proves a present 
zero survives.
   
   ### Deliberately not included
   
   `getCellLayer`'s `|| 0` fallback (line 752) is **unreachable**, and no test 
pins it. Mutating it to
   `?? -1` survives, and the reason is structural rather than a missing test: 
joint's `Graph.addCell`
   sets `z = maxZIndex() + 1` on any cell that arrives without one, and 
`getCellLayer` throws for a
   cell that is not in the graph — so `attributes.z` is never `undefined` where 
it is read. Deleting
   the `|| 0` outright does not compile (`z` is `number | undefined`), so it is 
load-bearing for typing
   only. That is recorded in the spec so the next reader does not re-derive it.
   
   Also left alone: the link-breakpoint members. 
`jointLinkBreakpointShowStream` and
   `jointLinkBreakpointHideStream` are private Subjects never `.next()`-ed 
anywhere in `frontend/src`,
   and `linksWithBreakpoints` is declared and read but never written.
   
   No production file is touched.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7508
   
   ### How was this PR tested?
   
   ```
   npx ng test --watch=false --include="**/joint-graph-wrapper.spec.ts"
   ```
   
   ```
    Test Files  1 passed (1)
         Tests  67 passed (67)
   ```
   
   20 new on top of the existing 47. `yarn format:ci` passes.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 5)
   


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