Ma77Ball opened a new issue, #5474:
URL: https://github.com/apache/texera/issues/5474
### Task Summary
`VisualizationFrameContentComponent`
(`frontend/src/app/workspace/component/visualization-panel-content/visualization-frame-content.component.ts`)
has no `*.spec.ts` file. It is ~87 lines, takes an `@Input() operatorId`,
and depends on
`WorkflowResultService` and `DomSanitizer`. Its work happens in
`ngAfterContentInit()` and
`drawChart()`.
### What to do (step by step)
1. Create the spec next to the component, with the Apache license header.
2. Stub `WorkflowResultService` to return the result/observable that
`drawChart` consumes
(read the method to see which getter it calls), and stub `DomSanitizer`
with a
`bypassSecurityTrust*` `vi.fn()`.
3. Set `component.operatorId` before triggering the lifecycle.
4. Assert creation and that `drawChart` pulls data via the service and sets
the field the
template renders.
5. Run `yarn test -- visualization-frame-content`, then `yarn lint`.
### Cover
- `should create`.
- `drawChart()` reads the operator result for `operatorId` from
`WorkflowResultService`
and produces the sanitized HTML / chart field the template binds to.
- A no-data / undefined-result branch (if present) is handled without
throwing.
### Suggested providers / mocks
```ts
import { WorkflowResultService } from
"src/app/workspace/service/workflow-result/workflow-result.service";
import { DomSanitizer } from "@angular/platform-browser";
const resultServiceSpy = { /* the getter drawChart calls, returning sample
result data */ };
providers: [
{ provide: WorkflowResultService, useValue: resultServiceSpy },
{ provide: DomSanitizer, useValue: { bypassSecurityTrustHtml: vi.fn(x =>
x) } },
]
```
### 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]