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

   ### Task Summary
   
   Two Angular templates hold panels that no test ever opens, so their markup 
never executes: **35 uncovered template lines** between them. Both component 
classes are already well covered (one at 100 %), which is the signature of a 
spec that drives the class but not the DOM. Goal: render each panel and bring 
both templates toward full coverage.
   
   Vitest/jsdom; see `frontend/TESTING.md` and `frontend/AGENTS.md`.
   
   The mechanics apply to both: call `fixture.detectChanges()` after each state 
change, query with `fixture.debugElement.query(By.css(...))` and fire events 
with `.triggerEventHandler(...)` instead of calling handlers on the instance, 
and set the flag each panel is gated on so its arm renders. Use the local 
coverage report to catch anything left over.
   
   ### Behavior to add
   
   **Search-instructions panel** 
(`frontend/src/app/dashboard/component/user/filters-instructions/filters-instructions.component.html`,
 codecov 15.0 %, 17 uncovered lines — EXTEND; the spec has a single `it()` 
block)
   
   The component class is already at **100 %**, so the entire gap is markup 
that never renders. Lines 30–48 are one contiguous help block that only appears 
when the instructions panel is open: the "We support the following search 
criteria" list (workflowName, `ctime:`, `mtime:`, `owner:`, `id:`, `operator:`, 
`project:`), the "You can change search parameters by" list, and the worked 
example line. Open the panel, render, and assert the criteria list is present 
with the expected number of `<li>` entries and that the example text renders. 
This is static markup — no async, no services.
   
   **Agent settings and operator-filter panels** 
(`frontend/src/app/workspace/component/agent/agent-panel/agent-chat/agent-chat.component.html`,
 codecov 90.1 %, 18 uncovered lines — EXTEND `agent-chat.component.spec.ts`)
   
   The remaining red lines are all inside modals and panels that stay closed:
   
   - **Settings modal** (lines 234, 241, 280–374) — the `[(ngModel)]` bindings 
and save buttons for `settingsMaxCharLimit` / `saveMaxCharLimit()`, 
`settingsMaxCellCharLimit` / `saveMaxCellCharLimit()`, 
`settingsToolTimeoutSeconds` / `saveToolTimeout()`, 
`settingsExecutionTimeoutMinutes` / `saveExecutionTimeout()`, and 
`settingsMaxSteps` / `saveMaxSteps()`. Set `isSystemInfoModalVisible` (and 
`isDetailsModalVisible` for line 234), render, change each bound input and 
click its save button, asserting the handler ran with the new value.
   - **Operator-type filter** (lines 409–436) — the `operatorTypeSearchQuery` 
input, `enableAllOperatorTypes()`, `deselectAllOperatorTypes()`, and the 
per-row `(ngModelChange)="toggleOperatorType(op.type, $event)"`. Seed the 
operator-type list so the `*ngFor` expands, then exercise select-all, 
deselect-all, and a single toggle.
   - **Tool-call summary** (lines 124, 133) — the `Execute {{ 
response.toolCalls.length }} tool{{ … > 1 ? 's' : '' }}` pluralisation and the 
`showResponseDetails(response)` click. Feed a response with one tool call and 
another with two so both sides of the ternary render.
   - **Message input** (line 189) — the `[(ngModel)]="currentMessage"` binding, 
exercised by typing into the rendered textarea.
   
   Determinism constraints for both files:
   - No layout or geometry assertions — `getBoundingClientRect` / 
`scrollHeight` return zeros under jsdom.
   - No assertions on `DatePipe`-rendered text (a fixed epoch renders a 
different day under a UTC runner).
   - `fixture.destroy()` in `afterEach` so any `@UntilDestroy` subscription 
stops between tests, and `vi.restoreAllMocks()` so spies do not leak.
   - Stub the agent service with `of(...)` or `HttpClientTestingModule` and 
flush synchronously; never hit a real backend.
   
   Out of scope: the streaming/websocket paths of the agent panel — cover the 
panel markup, not live transport.
   
   ### 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