@@ -185,29 +185,40 @@ describe('Test surface', function() {
185
185
186
186
} ) ;
187
187
188
-
189
188
describe ( 'Test dimension and expected visibility tests' , function ( ) {
190
189
var gd ;
191
190
192
191
beforeEach ( function ( ) {
193
192
gd = createGraphDiv ( ) ;
194
193
} ) ;
195
194
196
-
197
195
afterEach ( function ( ) {
198
196
Plotly . purge ( gd ) ;
199
197
destroyGraphDiv ( ) ;
200
198
} ) ;
201
199
202
-
203
200
function assertVisibility ( exp , msg ) {
204
201
expect ( gd . _fullData [ 0 ] ) . not . toBe ( undefined , 'no visibility!' ) ;
205
202
expect ( gd . _fullData [ 0 ] . visible ) . toBe ( exp , msg ) ;
206
203
}
207
204
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 ) {
209
218
Plotly . plot ( gd , [ {
210
219
'type' : 'surface' ,
220
+ 'x' : [ ] ,
221
+ 'y' : [ 0 , 1 ] ,
211
222
'z' : [ ]
212
223
} ] )
213
224
. then ( function ( ) {
@@ -217,35 +228,49 @@ describe('Test surface', function() {
217
228
. then ( done ) ;
218
229
} ) ;
219
230
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 ) {
221
246
Plotly . plot ( gd , [ {
222
247
'type' : 'surface' ,
223
248
'x' : [ 0 ] ,
224
249
'y' : [ 0 , 1 ] ,
225
250
'z' : [ [ 1 ] , [ 2 ] ]
226
251
} ] )
227
252
. then ( function ( ) {
228
- assertVisibility ( false , 'not to be visible' ) ;
253
+ assertVisibility ( true , 'to be visible' ) ;
229
254
} )
230
255
. catch ( failTest )
231
256
. then ( done ) ;
232
257
} ) ;
233
258
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 ) {
235
260
Plotly . plot ( gd , [ {
236
261
'type' : 'surface' ,
237
262
'x' : [ 0 , 1 ] ,
238
263
'y' : [ 0 ] ,
239
264
'z' : [ [ 1 , 2 ] ]
240
265
} ] )
241
266
. then ( function ( ) {
242
- assertVisibility ( false , 'not to be visible' ) ;
267
+ assertVisibility ( true , 'to be visible' ) ;
243
268
} )
244
269
. catch ( failTest )
245
270
. then ( done ) ;
246
271
} ) ;
247
272
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 ) {
249
274
Plotly . plot ( gd , [ {
250
275
'type' : 'surface' ,
251
276
'z' : [ [ 1 , 2 ] , [ 3 , 4 ] ]
@@ -257,7 +282,7 @@ describe('Test surface', function() {
257
282
. then ( done ) ;
258
283
} ) ;
259
284
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 ) {
261
286
Plotly . plot ( gd , [ {
262
287
'type' : 'surface' ,
263
288
'x' : [ 0 , 1 ] ,
0 commit comments