Skip to content

Commit

Permalink
add scatter3d visibility toggle test
Browse files Browse the repository at this point in the history
  • Loading branch information
etpinard committed Apr 7, 2016
1 parent c15ce0f commit ee35dc3
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion test/jasmine/tests/gl_plot_interact_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,17 @@ describe('Test gl plot interactions', function() {

beforeEach(function(done) {
gd = createGraphDiv();
Plotly.plot(gd, mock.data, mock.layout).then(function() {

var mockCopy = Lib.extendDeep({}, mock);

// lines, markers, text, error bars and surfaces each
// correspond to one glplot object
mockCopy.data[0].mode = 'lines+markers+text';
mockCopy.data[0].error_z = { value: 10 };
mockCopy.data[0].surfaceaxis = 2;
mockCopy.layout.showlegend = true;

Plotly.plot(gd, mockCopy.data, mockCopy.layout).then(function() {
delay(done);
});
});
Expand Down Expand Up @@ -190,6 +200,22 @@ describe('Test gl plot interactions', function() {
});
});

it('should be able to toggle visibility', function(done) {
var objects = gd._fullLayout.scene._scene.glplot.objects;

expect(objects.length).toEqual(5);

Plotly.restyle(gd, 'visible', 'legendonly').then(function() {
expect(objects.length).toEqual(0);

return Plotly.restyle(gd, 'visible', true);
}).then(function() {
expect(objects.length).toEqual(5);

done();
});
});

});

describe('gl2d plots', function() {
Expand Down

0 comments on commit ee35dc3

Please sign in to comment.