Ma77Ball opened a new issue, #5469:
URL: https://github.com/apache/texera/issues/5469
### Task Summary
`RowModalComponent`
(`frontend/src/app/workspace/component/result-panel/result-panel-modal.component.ts`)
has
no `*.spec.ts` file. It is a ~70-line modal with a single lifecycle hook
(`ngOnChanges`).
It depends on `NzModalRef`, `WorkflowResultService`, and
`PanelResizeService`, all of
which are easy to stub.
### What to do (step by step)
1. Create the spec next to the component, with the Apache license header.
2. Provide stubs for the three injected dependencies (see below).
3. Assert creation, and that `ngOnChanges()` produces the expected state
(inspect the
method body to see which field it sets from `workflowResultService` /
`modal`).
4. Run `yarn test -- result-panel-modal`, then `yarn lint`.
### Cover
- `should create`.
- `ngOnChanges()` populates the row data the modal displays. Read the method
to see which
service call it makes (it uses the modal's numeric config and
`WorkflowResultService`),
stub that call, then assert the resulting component field.
### Suggested providers / mocks
```ts
const workflowResultServiceSpy = { /* add the method ngOnChanges calls, as
vi.fn() */ };
const resizeServiceSpy = { /* add any method used, as vi.fn() */ };
providers: [
{ provide: NzModalRef, useValue: { getConfig: () => ({}), close: vi.fn() }
},
{ provide: WorkflowResultService, useValue: workflowResultServiceSpy },
{ provide: PanelResizeService, useValue: resizeServiceSpy },
]
```
Open the component first and match the stub methods to exactly what
`ngOnChanges` and the
constructor touch, so the stubs stay minimal.
### 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]