Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(point): Add custom point test #3423

Merged
merged 1 commit into from
Sep 13, 2023
Merged
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
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