@@ -73,7 +73,17 @@ describe('Test gl plot interactions', function() {
73
73
74
74
beforeEach ( function ( done ) {
75
75
gd = createGraphDiv ( ) ;
76
- Plotly . plot ( gd , mock . data , mock . layout ) . then ( function ( ) {
76
+
77
+ var mockCopy = Lib . extendDeep ( { } , mock ) ;
78
+
79
+ // lines, markers, text, error bars and surfaces each
80
+ // correspond to one glplot object
81
+ mockCopy . data [ 0 ] . mode = 'lines+markers+text' ;
82
+ mockCopy . data [ 0 ] . error_z = { value : 10 } ;
83
+ mockCopy . data [ 0 ] . surfaceaxis = 2 ;
84
+ mockCopy . layout . showlegend = true ;
85
+
86
+ Plotly . plot ( gd , mockCopy . data , mockCopy . layout ) . then ( function ( ) {
77
87
delay ( done ) ;
78
88
} ) ;
79
89
} ) ;
@@ -190,6 +200,22 @@ describe('Test gl plot interactions', function() {
190
200
} ) ;
191
201
} ) ;
192
202
203
+ it ( 'should be able to toggle visibility' , function ( done ) {
204
+ var objects = gd . _fullLayout . scene . _scene . glplot . objects ;
205
+
206
+ expect ( objects . length ) . toEqual ( 5 ) ;
207
+
208
+ Plotly . restyle ( gd , 'visible' , 'legendonly' ) . then ( function ( ) {
209
+ expect ( objects . length ) . toEqual ( 0 ) ;
210
+
211
+ return Plotly . restyle ( gd , 'visible' , true ) ;
212
+ } ) . then ( function ( ) {
213
+ expect ( objects . length ) . toEqual ( 5 ) ;
214
+
215
+ done ( ) ;
216
+ } ) ;
217
+ } ) ;
218
+
193
219
} ) ;
194
220
195
221
describe ( 'gl2d plots' , function ( ) {
0 commit comments