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

   ### What changes were proposed in this PR?
   
   Extends `LeftPanelComponent`'s spec to render the panel's tab lists and 
exercise
   their bindings. The class file is already at 100%, but the existing tests 
call
   the handlers directly and never render/click the tabs, so
   `left-panel.component.html` sat at ~41%.
   
   9 added tests render both the collapsed dock and the expanded panel, then 
drive
   each interactive element via `fixture.debugElement.query(By.css(...))` +
   `.triggerEventHandler(...)`:
   
   - Collapsed dock (`#docked-buttons`): clicking a tab re-opens that frame; 
only the enabled tabs render (disabled ones are omitted); the `width && 
!isDocked` minus button collapses the panel.
   - Expanded dock (`#dock`): clicking a tab switches frames; the `isDocked` 
minus collapses.
   - Return bar (`#return-button`): the reset button re-docks to the return 
position; its minus collapses.
   - Container events: the three menu lists' `(cdkDropListDropped)` reorder 
`order`, and the left container's `(cdkDragStarted)` / `(nzResize)` update the 
docked/size state.
   
   This lifts `left-panel.component.html` from ~41% to **100%** (statements and
   branches); the class stays at 100%.
   
   **Determinism (per the issue's constraint):** no `vi.useFakeTimers()` — the
   `setTimeout` `ngAfterViewInit` queues never runs in a synchronous test body, 
and
   layering fake timers over zone.js's patched timers is Node-version 
dependent. No
   `getBoundingClientRect`/offset assertions either — the tests assert the 
rendered
   tabs and the active-frame/width state, not measured heights. Tabs are 
located by
   the CDK `cdk-drag` class (the `nz-tooltip` attribute is consumed by the 
directive
   and not present in the DOM). No production code was changed.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7363
   
   ### How was this PR tested?
   
   Extended unit tests, run locally in `frontend/`:
   
   ```
   ng test --watch=false --include 
src/app/workspace/component/left-panel/left-panel.component.spec.ts
   # Test Files 1 passed (1) | Tests 28 passed (28)   — 3 consecutive runs, 0 
flakes
   # left-panel.component.html: ~41% -> 100% (statements & branches)
   prettier --write <spec>   # unchanged
   eslint  <spec>            # clean
   ```
   
   The failure path was verified by deliberately breaking a new assertion and
   confirming the suite exits non-zero. (Locally on Node 26 the component's
   `localStorage` reads need `NODE_OPTIONS=--localstorage-file=...`; CI runs 
Node 24
   where jsdom's `localStorage` is present, so no polyfill is added to the 
spec.)
   
   ### 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