From 0104302925005d8c3b6e1211b211565c71065042 Mon Sep 17 00:00:00 2001 From: netil Date: Wed, 13 Sep 2023 18:08:39 +0900 Subject: [PATCH] test(point): Add custom point test Ref #3333 --- test/shape/point-spec.ts | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/test/shape/point-spec.ts b/test/shape/point-spec.ts index d7dfa6c93..308f6bcd4 100644 --- a/test/shape/point-spec.ts +++ b/test/shape/point-spec.ts @@ -5,6 +5,7 @@ /* eslint-disable */ /* global describe, beforeEach, it, expect */ import {expect} from "chai"; +import {window} from "../../src/module/browser" import util from "../assets/util"; import {$CIRCLE} from "../../src/config/classes"; @@ -142,6 +143,44 @@ describe("SHAPE POINT", () => { it("custom point's position for null data shoudn't be set as NaN", () => { expect(chart.$.circles.filter(":last-child").attr("y")).to.not.equal("NaN"); }); + + it("set optiosn", () => { + args = { + data: { + columns: [ + ["data1", 30, 200, 100, 400, -150, 250], + ["data 2", 50, 20, 10, 40, 15, 25], + ["data3", -150, 120, 110, 140, 115, 125] + ], + selection: { + enabled: true + } + }, + point: { + pattern: [ + "" + ] + } + }; + }); + + it("", done => { + const target = { + id: "data3", + index: 2 + }; + + // when + chart.select(target.id, [target.index], true); + chart.hide(target.id); + + setTimeout(() => { + const point = chart.$.circles.filter(d => d.id === target.id && d.index == target.index).node(); + + expect(point.parentNode.style.opacity).to.be.equal("0"); + done(); + }, 300); + }); }); describe("point transition", () => {