Skip to content

Commit

Permalink
refactor(flow): Remove duplicated condition (#3362)
Browse files Browse the repository at this point in the history
- Remove duplicated condition "v === 'gridLines.x'
- Update test generation options

Ref #3360
  • Loading branch information
netil committed Aug 23, 2023
1 parent c23c62d commit d2bd8ab
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
3 changes: 0 additions & 3 deletions src/ChartInternal/interactions/flow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ export default {
} else if (v === "gridLines.x") {
n.attr("x1", isRotated ? 0 : xv)
.attr("x2", isRotated ? state.width : xv);
} else if (v === "gridLines.x") {
n.select("line").attr("x1", isRotated ? 0 : xv)
.attr("x2", isRotated ? state.width : xv);

n.select("text")
.attr("x", isRotated ? state.width : 0)
Expand Down
3 changes: 3 additions & 0 deletions test/api/flow-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,9 @@ describe("API flow", () => {
type: "line",
labels: true
},
point: {
type: "rectangle"
},
grid: {
x: {
show: true,
Expand Down
8 changes: 4 additions & 4 deletions test/interactions/drag-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ describe("DRAG", function() {
}, 500);
});

it("set options: data.type='bar'", () => {
args.data.type = "pie";
it("set options: data.selection.enabled=fasle", () => {
args.data.selection.enabled = false;
});

it("pie shouldn't be selected by drag", done => {
it("shouldn't be selected by drag", done => {
const {internal: {$el}} = chart;

util.doDrag($el.arcs.node(), {
util.doDrag($el.eventRect.node(), {
clientX: 34.5,
clientY: 20
}, {
Expand Down
2 changes: 0 additions & 2 deletions test/internals/data-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1129,8 +1129,6 @@ describe("DATA", () => {
afterEach(() => {
spyHidden.resetHistory();
spyShown.resetHistory();

chart.destroy();
});

it("check on continuous .hide()/.show() APIs.", function(done) {
Expand Down

0 comments on commit d2bd8ab

Please sign in to comment.