mengw15 opened a new issue, #7654:
URL: https://github.com/apache/texera/issues/7654
### Task Summary
Four component templates each have a small block that is never rendered (~24
uncovered lines total). In every case the missing markup is a region that only
appears in a particular state — an editor toolbar, a loading spinner, a modal
header, a form body — so the spec never reaches it. **Goal: bring all four
templates to full coverage** — render each of those states and drive the
bindings, then use the local coverage report to catch anything left.
Vitest/jsdom; see `frontend/TESTING.md`.
General approach for all four:
- `fixture.detectChanges()` after **every** state change — it is the
template-coverage switch.
- Drive bindings through the DOM
(`fixture.debugElement.query(By.css("..."))` + `.triggerEventHandler("click",
...)`) rather than calling handlers directly, so the `(click)` attribute itself
executes.
- Assert rendered text / bound attributes / delegated calls — never layout
or geometry (zeros under jsdom).
None of these four has a determinism hazard: no timers, no `new Date`, no
date pipe, and none of their specs uses `TestBed.overrideComponent` (so
template coverage is attributed normally).
### Behavior to add
**MarkdownDescriptionComponent**
(`frontend/src/app/workspace/component/markdown-description/markdown-description.component.html`,
~88%, 6 lines)
- The gap is the **edit-mode editor**: the toolbar buttons
`(click)="insert(btn)"`, and the textarea's `[(ngModel)]="editingContent"` with
`(ngModelChange)="renderMarkdown($event)"`.
- Enter edit mode, `detectChanges()`, click a toolbar button and assert the
inserted markup lands in the bound content; set the textarea value + dispatch
`input` and assert `renderMarkdown` produced the preview.
**AgentRegistrationComponent**
(`frontend/src/app/workspace/component/agent/agent-registration/agent-registration.component.html`,
~86%, 6 lines)
- The gap is the **loading branch** (`<nz-spin>` with "Loading available
models…") and the model-type picker `(click)="selectModelType(modelType.id)"`.
- Render with the loading flag set so the spinner and its caption appear;
then with models loaded, click a model type and assert the selection state
changes.
**RegistrationRequestModalComponent**
(`frontend/src/app/common/service/user/registration-request-modal/registration-request-modal.component.html`,
~68%, 6 lines)
- The gap is the **modal header** block — the `registration-modal-title`
container, the "Request access" label and the icon `<img>`.
- Render the component (providing `NZ_MODAL_DATA`) and assert the header
renders: the title text and the image's bound `src`/`alt`.
**PortPropertyEditFrameComponent**
(`frontend/src/app/workspace/component/property-editor/port-property-edit-frame/port-property-edit-frame.component.html`,
~67%, 6 lines)
- The gap is the **form body**: the `{{ formTitle }}` heading and the
`[formGroup]="formlyFormGroup"` block.
- Provide a port whose schema yields a form, `detectChanges()`, and assert
the heading text matches `formTitle` and that the formly form is rendered (its
fields appear in the DOM).
### 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]