mengw15 opened a new pull request, #7840:
URL: https://github.com/apache/texera/pull/7840
### What changes were proposed in this PR?
The spec called the handlers directly and rendered almost nothing. These 14
tests fire them
from the markup instead, taking `menu.component.html` from 187/295
statements to 266/295 and
its branches from 32/58 to 42/58 — 74 uncovered lines down to 19.
- **Version bar** — the whole `displayParticularWorkflowVersion` arm: the
name input gives
way to the version label, the back button closes the display, restore is
offered only
while the version service allows it (both states asserted) and clone is
wired; the
"Current Version: N" label appears only when a version id is selected; one
icon renders
per co-editor.
- **Workflow name field** — the id badge appears only with a workflow id,
and typing and
committing the name reach `adjustWorkflowNameWidth` /
`onWorkflowNameChange`.
- **Toolbar** — create, save, delete-all, export and edit-description fired
from their
buttons.
- **Operator actions** — each of disable / view-result / reuse-result
renders as one of two
buttons depending on the state it would move to; both are driven, plus the
disabled state
when nothing is selected. Undo and redo are wired and are disabled while
an older version
is displayed.
- **Execution buttons** — share, kill and run; and the checkpoint button,
which appears only
with time travel enabled and is enabled only while the execution is paused.
What made this reachable: the utilities block is rendered inline by the
unconditional
`ngTemplateOutlet` in `#expanded-utilities` (the responsive hiding is CSS,
not `*ngIf`), so
the operator actions and history buttons are in the DOM under jsdom without
opening the
dropdown that also renders them.
Per the issue: no assertions on layout or on `DatePipe`-rendered text,
`fixture.destroy()`
and `vi.restoreAllMocks()` in the block's `afterEach`, and nothing asserted
about
project-specific menu entries.
No production code was changed.
### The 19 lines left, and why
All of them are content ng-zorro renders into a CDK overlay, which jsdom
does not attach:
- **170, 178, 186, 194** — the Layers checkboxes and their `(ngModelChange)`
handlers. They
live in `<nz-dropdown-menu #menu>`;
`queryAll(By.css("label[nz-checkbox]"))` finds none
anywhere in the fixture, so there is nothing to drive.
- **419-430** — the `#executionSettings` popover content (execution name
input, email
notification switch), reached only through `[nzPopoverContent]`.
- **442-448** — the `#clusterInfo` tooltip content (connected/disconnected
text, computing
unit status, worker count), reached only through `[nzTooltipTitle]`.
I hit the same wall on #7655 and chose not to build timing machinery for it
there either:
the overlay appears only after an unbounded wait, so covering these would
mean guessing a
duration — the flake this repo's specs avoid.
### Any related issues, documentation, discussions?
Closes #7837.
Rebased on current `main`. No assertions depend on the project menu entries
#7463 removes.
### How was this PR tested?
`ng test --watch=false --include
src/app/workspace/component/menu/menu.component.spec.ts` —
76 passed (62 existing + 14 new), run 3x for determinism. Coverage
(`--coverage`) gives the
numbers above. The failure path was verified by breaking an assertion (red,
non-zero exit)
and restoring it. `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]