svonderohe commented on code in PR #20563:
URL: https://github.com/apache/echarts/pull/20563#discussion_r1873548815


##########
test/ut/spec/chart/line/LineView.test.ts:
##########
@@ -0,0 +1,26 @@
+import LineView from "@/src/chart/line/LineView";
+import { HOVER_STATE_EMPHASIS } from "@/src/util/states";
+import { ECElement } from "@/src/util/types";
+
+describe('LineView', function () {
+
+    let lineView: LineView;
+    beforeEach(function () {
+        lineView = new LineView();
+        lineView.init();
+    });
+
+    it('should change poly state when polygon is set', function () {
+        lineView._polygon = lineView._newPolygon(
+            [], [],
+        );
+        lineView._changePolyState('emphasis');
+        expect((lineView._polygon as 
ECElement).hoverState).toBe(HOVER_STATE_EMPHASIS);
+    });
+
+    it('should not error on state change when polygon is not set', function () 
{
+        lineView._polygon = null;
+        expect(() => lineView._changePolyState('emphasis')).not.toThrow();
+    });

Review Comment:
   This test case would fail before the change in this PR



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to