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

   ### Task Summary
   
   `ReActStepDetailModalComponent`
   
(`frontend/src/app/workspace/component/agent/agent-panel/react-step-detail-modal/react-step-detail-modal.component.ts`)
   has no `*.spec.ts` file. Despite its length, it has **no injected 
services**. It is mostly
   pure formatting/parsing helpers over plain objects, which makes it very 
testable without
   mocks. It exposes `@Input`s (`visible`, `step`, `agentId`) and an `@Output`
   (`visibleChange`).
   
   ### What to do (step by step)
   
   1. Create the spec next to the component, with the Apache license header.
   2. No providers are needed beyond importing the standalone component.
   3. Drive the pure helpers with small hand-built objects and assert the 
returned strings.
   4. Run `yarn test -- react-step-detail-modal`, then `yarn lint`.
   
   ### Cover (pick the pure helpers first, they are the easy wins)
   
   - `should create`.
   - `closeModal()` sets `visible = false` and emits `false` on `visibleChange`
     (use `vi.spyOn(component.visibleChange, "emit")`).
   - `formatResult(data)` and `formatJson(data)`: pass an object, assert 
pretty-printed JSON;
     pass a string, assert it is returned as-is where applicable.
   - `getMessageRoleColor(role)`: assert the color returned for a couple of 
known roles and
     the default.
   - `getTextFromMessage(msg)`, `getToolCallStrings(msg)`, 
`getToolCallSummaries(msg)`,
     `getToolResultItems(msg)`: feed representative message objects and assert 
the extracted
     fields. Look at the `ReActStep` type for shape hints.
   - `hasOperatorAccess(step)`: true/false branches.
   
   ### Tips
   
   - These helpers are deterministic; build the smallest input object that 
exercises each
     branch and assert the exact output.
   - You do not need `fixture.detectChanges()` for the pure-helper tests; call 
methods on the
     component instance directly.
   
   ### 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