Copilot commented on code in PR #8500:
URL: https://github.com/apache/texera/pull/8500#discussion_r3985541030
##########
frontend/src/app/workspace/service/workflow-graph/util/workflow-util.service.spec.ts:
##########
@@ -219,6 +219,21 @@ describe("WorkflowUtilService", () => {
expect(parsed.content).toBe(content);
});
+ // The persist endpoint returns the stored row, which names the publish flag
isPublic; the rest
+ // of the frontend knows it as isPublished. Without the carry-over, a save
fed back as metadata
+ // lost the flag, and the next save went out without it.
+ it("should carry the persist response's isPublic over to isPublished", () =>
{
+ const fromPersist = { wid: 1, name: "n", content: "{}", isPublic: true }
as unknown as Workflow;
+
+
expect(WorkflowUtilService.parseWorkflowInfo(fromPersist).isPublished).toBe(1);
Review Comment:
The carry-over path is only asserted for `isPublic: true`. Private workflows
exercise the other conversion (`Number(false) === 0`), so add an assertion for
`isPublic: false` mapping to `isPublished: 0`; otherwise a regression in the
false case would go undetected.
--
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]