Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,41 @@ describe("WorkflowVersionService", () => {
});
});

// ─── unhighlightOpVersionDiff ─────────────────────────────────────────────

describe("unhighlightOpVersionDiff", () => {
it("resets the boundary fill of added and modified ops to transparent", () => {
service.unhighlightOpVersionDiff({ modified: ["m"], added: ["a"], deleted: [] });

expect(paperGetModelById).toHaveBeenCalledWith("m");
expect(paperGetModelById).toHaveBeenCalledWith("a");
expect(modelAttr).toHaveBeenCalledWith("rect.boundary/fill", "rgba(0,0,0,0)");
});

it("resets the red brackets drawn around the neighbors of deleted ops", () => {
const tempWorkflow = buildWorkflow({
content: buildContent({
operators: [buildOperator({ operatorID: "alive-left" }), buildOperator({ operatorID: "alive-right" })],
links: [buildLink("dead", "alive-right"), buildLink("alive-left", "dead")],
}),
});
actionSpy.getTempWorkflow.mockReturnValue(tempWorkflow);

service.unhighlightOpVersionDiff({ modified: [], added: [], deleted: ["dead"] });

expect(modelAttr).toHaveBeenCalledWith("path.left-boundary/stroke", "rgba(0,0,0,0)");
expect(modelAttr).toHaveBeenCalledWith("path.right-boundary/stroke", "rgba(0,0,0,0)");
});

it("skips bracket clearing when the temp workflow is missing", () => {
actionSpy.getTempWorkflow.mockReturnValue(undefined);

service.unhighlightOpVersionDiff({ modified: [], added: [], deleted: ["dead"] });

expect(getMainJointPaper).not.toHaveBeenCalled();
});
});

// ─── getWorkflowsDifference / getOperatorsDifference ──────────────────────

describe("getWorkflowsDifference", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,20 @@ export class WorkflowVersionService {
for (const id of differentOpIDsList.added.concat(differentOpIDsList.modified)) {
this.highlightOpBoundary(id, "0,0,0,0");
}

if (differentOpIDsList.deleted.length > 0) {
const tempWorkflow = this.workflowActionService.getTempWorkflow();
if (tempWorkflow != undefined) {
for (const link of tempWorkflow.content.links) {
if (differentOpIDsList.deleted.includes(link.source.operatorID) && link.target.operatorID != undefined) {
this.highlightOpBracket(link.target.operatorID, "0,0,0,0", "left-");
}
if (differentOpIDsList.deleted.includes(link.target.operatorID) && link.source.operatorID != undefined) {
this.highlightOpBracket(link.source.operatorID, "0,0,0,0", "right-");
}
}
}
}
this.operatorPropertyDiff = {};
}

Expand Down
Loading