aglinxinyuan opened a new issue, #7900:
URL: https://github.com/apache/texera/issues/7900

   ### Task Summary
   
   Three small templates, all with function counters far worse than their line 
percentages suggest:
   
   | Template | Coverage |
   |---|---|
   | `email-request-modal.component.html` | 54.5% lines, **0/2 branches, 0/1 
functions** |
   | `hub/landing-page.component.html` | 76.2% lines, **0/2 functions** |
   | `user-venv.component.html` | 93.0% lines but **3/12 branches**, 8/12 
functions |
   
   `email-request-modal` arrived with the sign-in email prompt in #7758, so 
expect genuinely thin tests rather than an attribution artifact. For the other 
two, check whether the spec uses `TestBed.overrideComponent` (#7458) — verify 
in both directions.
   
   Two of the wins are cheap once located: a `createEmbeddedView` of the 
modal-title template, and the single `fixture.detectChanges()` that 
landing-page's spec never calls.
   
   Traps, all measured:
   
   1. **A fresh worktree has no `frontend/node_modules`** — `npx ng test` fails 
with "Could not find the '@angular/build:unit-test' builder's node package". 
Either `yarn install` or junction it from the main checkout (`package.json` and 
`yarn.lock` are byte-identical, and `node_modules` is gitignored).
   2. **`ng test --coverage` writes no lcov at all when any test fails.** 
Measure only from a green run — the same trap as sbt-jacoco's `saveRuntimeData`.
   3. **nz-modal body and footer render into `document.body`'s 
`.cdk-overlay-container`**, so `fixture.debugElement` and `By.css` find 
nothing. The existing spec's `overlay()` / `footerButton()` helpers already 
handle this.
   4. **nz-select options cannot be clicked in jsdom.** Clicking the host does 
open it, but `.ant-select-item-option` count is 0 because nz-option-container 
is a CDK virtual-scroll viewport and every element measures 0px. The working 
path is the keyboard: `keydown` on `nz-select-top-control` with ArrowDown then 
Enter — and because ng-zorro reads `e.keyCode`, you must attach it 
(`Object.defineProperty(ev,'keyCode',{get:()=>40})`); a bare `new 
KeyboardEvent('keydown',{key:'ArrowDown'})` does nothing.
   5. **`nz-option-item` nodes do not exist at all** in jsdom, so any assertion 
on rendered option nodes is a false positive waiting to happen. Label-to-value 
correspondence can only be pinned by walking the options with the keyboard.
   6. **`selectedOperatorLabel` is only valid after the panel has opened once** 
— ng-zorro resolves a pre-set model value against its options when the option 
list first registers.
   
   One line's second arm in `user-venv.component.html` is an unreachable 
partial: a null guard on a column the DDL declares `NOT NULL`. Reaching it 
needs an off-type fixture, which documents a defect rather than earning 
coverage — label it as such if you keep it.
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [x] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   


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