Ma77Ball commented on code in PR #6675:
URL: https://github.com/apache/texera/pull/6675#discussion_r3627121405


##########
frontend/src/app/workspace/service/workflow-graph/model/workflow-graph.spec.ts:
##########
@@ -815,4 +829,70 @@ describe("WorkflowGraph", () => {
       sub.unsubscribe();
     });
   });
+
+  describe("isSink", () => {
+    const makeOperator = (operatorType: string): OperatorPredicate => ({
+      operatorID: "op",
+      operatorType,
+      operatorVersion: "v",
+      operatorProperties: {},
+      inputPorts: [],
+      outputPorts: [],
+      showAdvanced: true,
+      isDisabled: false,
+    });
+
+    it("should return true for the view-result sink operator type", () => {
+      expect(isSink(makeOperator(VIEW_RESULT_OP_TYPE))).toBe(true);
+    });
+
+    it("should return true whenever the operator type contains 'sink' as a 
substring", () => {
+      expect(isSink(makeOperator("CsvFileSink"))).toBe(true);
+      expect(isSink(makeOperator("SinkOperator"))).toBe(true);
+    });
+
+    it("should match case-insensitively", () => {
+      expect(isSink(makeOperator("SINK"))).toBe(true);
+      expect(isSink(makeOperator("SiNk"))).toBe(true);
+      expect(isSink(makeOperator("mySINKop"))).toBe(true);
+    });

Review Comment:
   Good catch, switched `isSink` to `toLowerCase()` so the case-insensitive 
match is locale-independent and will not break under locales like Turkish. 
`isPythonUdf` does an exact array comparison with no case-folding, so it is not 
affected.
   



-- 
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]

Reply via email to