@@ -185,29 +185,40 @@ describe('Test surface', function() {
185185
186186 } ) ;
187187
188-
189188 describe ( 'Test dimension and expected visibility tests' , function ( ) {
190189 var gd ;
191190
192191 beforeEach ( function ( ) {
193192 gd = createGraphDiv ( ) ;
194193 } ) ;
195194
196-
197195 afterEach ( function ( ) {
198196 Plotly . purge ( gd ) ;
199197 destroyGraphDiv ( ) ;
200198 } ) ;
201199
202-
203200 function assertVisibility ( exp , msg ) {
204201 expect ( gd . _fullData [ 0 ] ) . not . toBe ( undefined , 'no visibility!' ) ;
205202 expect ( gd . _fullData [ 0 ] . visible ) . toBe ( exp , msg ) ;
206203 }
207204
208- fit ( '@gl surface should be invisible when the z array is empty' , function ( done ) {
205+ it ( '@gl surface should be invisible when the z array is empty' , function ( done ) {
206+ Plotly . plot ( gd , [ {
207+ 'type' : 'surface' ,
208+ 'z' : [ ]
209+ } ] )
210+ . then ( function ( ) {
211+ assertVisibility ( false , 'not to be visible' ) ;
212+ } )
213+ . catch ( failTest )
214+ . then ( done ) ;
215+ } ) ;
216+
217+ it ( '@gl surface should be invisible when the x array is defined but is empty' , function ( done ) {
209218 Plotly . plot ( gd , [ {
210219 'type' : 'surface' ,
220+ 'x' : [ ] ,
221+ 'y' : [ 0 , 1 ] ,
211222 'z' : [ ]
212223 } ] )
213224 . then ( function ( ) {
@@ -217,35 +228,49 @@ describe('Test surface', function() {
217228 . then ( done ) ;
218229 } ) ;
219230
220- fit ( '@gl surface should be invisible when the x array is defined but has less than two rows' , function ( done ) {
231+ it ( '@gl surface should be invisible when the y array is defined but is empty' , function ( done ) {
232+ Plotly . plot ( gd , [ {
233+ 'type' : 'surface' ,
234+ 'x' : [ 0 , 1 ] ,
235+ 'y' : [ ] ,
236+ 'z' : [ ]
237+ } ] )
238+ . then ( function ( ) {
239+ assertVisibility ( false , 'not to be visible' ) ;
240+ } )
241+ . catch ( failTest )
242+ . then ( done ) ;
243+ } ) ;
244+
245+ it ( '@gl surface should be invisible when the x array is defined and has at least one item' , function ( done ) {
221246 Plotly . plot ( gd , [ {
222247 'type' : 'surface' ,
223248 'x' : [ 0 ] ,
224249 'y' : [ 0 , 1 ] ,
225250 'z' : [ [ 1 ] , [ 2 ] ]
226251 } ] )
227252 . then ( function ( ) {
228- assertVisibility ( false , 'not to be visible' ) ;
253+ assertVisibility ( true , 'to be visible' ) ;
229254 } )
230255 . catch ( failTest )
231256 . then ( done ) ;
232257 } ) ;
233258
234- fit ( '@gl surface should be invisible when the y array is defined but has less than two colums ' , function ( done ) {
259+ it ( '@gl surface should be invisible when the y array is defined and has at least one item ' , function ( done ) {
235260 Plotly . plot ( gd , [ {
236261 'type' : 'surface' ,
237262 'x' : [ 0 , 1 ] ,
238263 'y' : [ 0 ] ,
239264 'z' : [ [ 1 , 2 ] ]
240265 } ] )
241266 . then ( function ( ) {
242- assertVisibility ( false , 'not to be visible' ) ;
267+ assertVisibility ( true , 'to be visible' ) ;
243268 } )
244269 . catch ( failTest )
245270 . then ( done ) ;
246271 } ) ;
247272
248- fit ( '@gl surface should be visible when the x and y are not provided; but z array is provided' , function ( done ) {
273+ it ( '@gl surface should be visible when the x and y are not provided; but z array is provided' , function ( done ) {
249274 Plotly . plot ( gd , [ {
250275 'type' : 'surface' ,
251276 'z' : [ [ 1 , 2 ] , [ 3 , 4 ] ]
@@ -257,7 +282,7 @@ describe('Test surface', function() {
257282 . then ( done ) ;
258283 } ) ;
259284
260- fit ( '@gl surface should be invisible when the x and y are provided; but z array is not provided' , function ( done ) {
285+ it ( '@gl surface should be invisible when the x and y are provided; but z array is not provided' , function ( done ) {
261286 Plotly . plot ( gd , [ {
262287 'type' : 'surface' ,
263288 'x' : [ 0 , 1 ] ,
0 commit comments