aglinxinyuan opened a new issue, #6258:
URL: https://github.com/apache/texera/issues/6258
### Task Summary
Add `workflow-check.spec.ts` covering `checkIfWorkflowBroken`, which reports
whether any link in a workflow references an operator ID that does not exist.
## Background
`frontend/src/app/common/util/workflow-check.ts` exports one pure predicate
and has no test.
```ts
export function checkIfWorkflowBroken(workflow: Workflow): boolean {
const validOperatorIDs = new Set(workflow.content.operators.map(o =>
o.operatorID));
return workflow.content.links.some(
link => !validOperatorIDs.has(link.source.operatorID) ||
!validOperatorIDs.has(link.target.operatorID)
);
}
```
## Behavior to pin
| Scenario | Result |
| --- | --- |
| every link's `source` / `target` operatorID exists | `false` |
| a link whose `source.operatorID` is missing from the operator list |
`true` |
| a link whose `target.operatorID` is missing | `true` |
| no links | `false` |
Build a minimal `Workflow`-shaped fixture with just `content.operators`
(each with an `operatorID`) and `content.links` (each with `source.operatorID`
/ `target.operatorID`) — only the fields the function reads. Follow
`size-formatter.util.spec.ts` in `common/util/` as the style template (`ng
test`).
## Scope
- New spec: `frontend/src/app/common/util/workflow-check.spec.ts`.
- No production-code changes.
### 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]