Skip to content

Commit

Permalink
test(point): Add custom point test (#3423)
Browse files Browse the repository at this point in the history
Ref #3333
  • Loading branch information
netil authored Sep 13, 2023
1 parent bacc287 commit 20fc229
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions test/shape/point-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

Expand Down Expand Up @@ -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: [
"<polygon points='2.5 0 0 5 5 5'></polygon>"
]
}
};
});

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", () => {
Expand Down

0 comments on commit 20fc229

Please sign in to comment.