aglinxinyuan opened a new pull request, #7901:
URL: https://github.com/apache/texera/pull/7901
### What changes were proposed in this PR?
Three small templates. 57 tests → 70.
Measured from `frontend/` with `ng test --coverage
--coverage-reporters=lcovonly`, the same spec-file filter on both sides, `rm
-rf coverage` between runs. lcov parsed with Codecov's model.
| Template | Before | After |
|---|---|---|
| `email-request-modal.component.html` | 6/11 = 54.5%, branches **0/2**,
functions **0/1** | **11/11 = 100%**, branches 2/2, functions 1/1 |
| `landing-page.component.html` | 16/21 = 76.2%, functions **0/2** | **21/21
= 100%**, functions 2/2 |
| `user-venv.component.html` | 66/71 = 93.0%, branches **3/12**, functions
8/12 | **71/71 = 100%**, branches 12/12, functions 12/12 |
**Measured +15 lines. I claim +14, and the difference matters.** One line
and one arm come only from an off-type `{name: null} as unknown as
UserPveRecord` fixture — a state the schema forbids (`virtual_environments.name
VARCHAR(128) NOT NULL`). That test is kept, but relabeled in the source as
*documentation, not coverage*, because it records a real defect rather than
earning a number. So: **+14 defensible lines, +10 arms, +7 functions.**
Two of the wins were embarrassingly cheap once found: four lines from a
single `createEmbeddedView` of the modal-title template, and five lines from
the one `fixture.detectChanges()` that landing-page's 13-test spec never called.
### Verification
21 mutations. The first draft reported no survivors; **nine mutants survived
it** — the nz-option label exchange, both discard-path rewires, the operator
select's hardcoded index, and more. All are now dead.
Its framing was also wrong in a way worth naming: "100% branches" did not
mean the arms were *constrained*. Both discard paths could be rewired to
`saveEnvironment()` and stay green at 100%.
### Two reviewer suggestions were refused, one because it would have been a
false positive
- A suggested selector **would fail on the clean template**, so it was a
mutant "kill" that proves nothing. Probed: it matches three inputs, because
nz-select renders its own.
- Another suggested asserting on rendered `nz-option-item` nodes. Those
nodes **do not exist at all** in jsdom — probed with the panel open,
`document.querySelectorAll('nz-option-item')` returns zero, because
nz-option-container is a CDK virtual-scroll viewport and every element measures
0px. Label↔value correspondence can only be pinned by walking the options with
the keyboard, which is what the test now does.
A third suggestion offered two options; the one taken keeps the test and
documents the defect, since deleting it would lose that record.
### Six survivors, all one class
Five are static presentational copy no test observes — a placeholder, a
dialog title, a tooltip, a popconfirm title, an `<h1>`. The line drawn is
deliberate: rendered-effect attributes carrying interaction meaning are pinned;
pure copy strings are not. The popconfirm's *behaviour* — first click only
opens the popover, the row survives until confirm — is pinned.
### Reported, not pinned
`UserVenvComponent.saveEnvironment()` calls `draft.name.trim()` where the
name can be absent. Fixing that is a production change, so it is documented in
the spec rather than asserted.
Line 90's second arm in `user-venv.component.html` is an unreachable partial
— a null guard on a column the DDL declares `NOT NULL`.
Also recorded for whoever works here next: `selectedOperatorLabel` is only
valid *after* the select's panel has been opened once, because ng-zorro
resolves a pre-set model value against its options when the option list first
registers.
No production file is touched.
### Any related issues, documentation, discussions?
Closes #7900
### How was this PR tested?
```
npx ng test --watch=false
--include="**/email-request-modal.component.spec.ts"
--include="**/landing-page.component.spec.ts"
--include="**/user-venv.component.spec.ts"
```
```
Test Files 3 passed (3)
Tests 70 passed (70)
```
Test counts verified two ways — the runner's output and `grep -c '^\s*it('`
per file (7 / 16 / 47). `npx tsc -p src/tsconfig.spec.json --noEmit` exits 0
and `yarn format:ci` passes. `frontend/junit.xml` and `frontend/coverage/` are
regenerated every run and are not committed.
### 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]