aglinxinyuan opened a new issue, #7890:
URL: https://github.com/apache/texera/issues/7890
### Task Summary
Two workspace templates have small but genuine gaps, and both are reachable
from plain jsdom tests:
| Template | Coverage |
|---|---|
| `result-exportation/result-exportation.component.html` | 89.6% lines,
branches **9/18**, functions **4/8** |
| `ui-udf-parameters/ui-udf-parameters.component.html` | 87.0% lines,
branches 6/8, functions **0/5** |
The function counters are the real signal —
`ui-udf-parameters.component.html` has **zero of its five template functions
covered**, which its line percentage hides completely.
Neither is an instance of #7458 (the `TestBed.overrideComponent` attribution
loss), so this is a straight extension of two existing specs — but verify that
rather than assuming it, in both directions.
The important finding, and the reason this is worth doing:
**An existing comment in `result-exportation.component.spec.ts` claims the
nz-autocomplete option bodies are unreachable in jsdom.** It says the option
content "only enters the DOM once the autocomplete panel expands, which jsdom
does not drive". That is wrong, and it blocks nothing:
`NzAutocompleteTriggerDirective` declares a host `focusin` listener that runs
`handleFocus()` → `canOpen()` → `openPanel()`, so dispatching `new
Event("focusin")` on the search input and calling `detectChanges()` attaches
the panel.
Two consequences for whoever writes this:
1. The options render into the **overlay container in `document.body`**, so
query them with `document.querySelectorAll(...)`. `fixture.debugElement`
returns zero.
2. Derive the expected option count from the component's own filtered list,
so a stale overlay left by a sibling test cannot make the assertion vacuous.
The existing `afterEach` already calls `fixture.destroy()`, which detaches it.
Other traps:
- **Formly field configs must be bare `{key: "..."}`.** Attaching a real
`FormControl` before render makes `FormlyField` throw `TypeError: Cannot
destructure property 'updateOn' of 'field.modelOptions'`, because
`fieldChanges()` assumes a fully built Formly field. So the "value editable,
name and type locked" behaviour cannot be asserted through a *rendered*
formly-field without standing up a full `FormlyModule.forRoot` form; it is
already covered at the unit level, and the rendered-row test should assert
structure instead.
- **`frontend/junit.xml` and `frontend/coverage/` are regenerated on every
run** and `junit.xml` is not gitignored — committing it fails the
license-header check.
- **`ng test --coverage` writes no lcov at all when any test fails**, so
only measure from a green run. This is the frontend analogue of the sbt-jacoco
`saveRuntimeData` failure mode.
- jsdom prints two `AggregateError` blocks from `xhr-utils.js` during these
specs. Pre-existing — present identically in the untouched baseline.
No production seam is needed; every line in this gap is reachable from a
test-only change.
### 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]