Skip to content

Commit 9aa06d2

Browse files
committed
add deleteTrace test for big indice arrays
1 parent b7281b4 commit 9aa06d2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/jasmine/tests/plot_api_test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,32 @@ describe('Test plot api', function() {
141141

142142
});
143143

144+
it('should work with more than 10 indices', function() {
145+
gd.data = [];
146+
147+
for(var i = 0; i < 20; i++) {
148+
gd.data.push({
149+
name: 'trace #' + i
150+
});
151+
}
152+
153+
var expectedData = [
154+
{name: 'trace #12'},
155+
{name: 'trace #13'},
156+
{name: 'trace #14'},
157+
{name: 'trace #15'},
158+
{name: 'trace #16'},
159+
{name: 'trace #17'},
160+
{name: 'trace #18'},
161+
{name: 'trace #19'}
162+
];
163+
164+
Plotly.deleteTraces(gd, [0,1,2,3,4,5,6,7,8,9,10,11]);
165+
expect(gd.data).toEqual(expectedData);
166+
expect(PlotlyInternal.redraw).toHaveBeenCalled();
167+
168+
});
169+
144170
});
145171

146172
describe('Plotly.addTraces', function() {

0 commit comments

Comments
 (0)