@@ -73,7 +73,17 @@ describe('Test gl plot interactions', function() {
7373
7474 beforeEach ( function ( done ) {
7575 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 ( ) {
7787 delay ( done ) ;
7888 } ) ;
7989 } ) ;
@@ -190,6 +200,22 @@ describe('Test gl plot interactions', function() {
190200 } ) ;
191201 } ) ;
192202
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+
193219 } ) ;
194220
195221 describe ( 'gl2d plots' , function ( ) {
0 commit comments