Skip to content

Commit b76e894

Browse files
committed
Add jasmine test for clearing and adding zindex traces
1 parent 17ffddb commit b76e894

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/jasmine/tests/cartesian_interact_test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2666,4 +2666,36 @@ describe('Cartesian taces with zindex', function() {
26662666
})
26672667
.then(done, done.fail);
26682668
});
2669+
2670+
it('should be able to clear traces', function(done) {
2671+
Plotly.newPlot(gd, fig(data0))
2672+
.then(function() {
2673+
var tracesData = d3SelectAll('g[class^="scatterlayer"]')[0];
2674+
expect(tracesData.length).toBe(3)
2675+
})
2676+
.then(function() {
2677+
return Plotly.react(gd, fig([data0[0]]));
2678+
})
2679+
.then(function() {
2680+
var tracesData = d3SelectAll('g[class^="scatterlayer"]')[0];
2681+
expect(tracesData.length).toBe(1)
2682+
})
2683+
.then(done, done.fail);
2684+
});
2685+
2686+
it('should be able to add traces', function(done) {
2687+
Plotly.newPlot(gd, fig([data0[0]]))
2688+
.then(function() {
2689+
var tracesData = d3SelectAll('g[class^="scatterlayer"]')[0];
2690+
expect(tracesData.length).toBe(1)
2691+
})
2692+
.then(function() {
2693+
return Plotly.react(gd, fig(data0));
2694+
})
2695+
.then(function() {
2696+
var tracesData = d3SelectAll('g[class^="scatterlayer"]')[0];
2697+
expect(tracesData.length).toBe(3)
2698+
})
2699+
.then(done, done.fail);
2700+
});
26692701
});

0 commit comments

Comments
 (0)