@@ -311,6 +311,15 @@ YUI.add('ez-universaldiscoveryfinderexplorerlevelview-tests', function (Y) {
311
311
Assert . areSame ( this . view . get ( 'items' ) [ 0 ] . contentType , this . result . contentType , 'item should have a location' ) ;
312
312
Assert . areSame ( this . view . get ( 'items' ) [ 0 ] . contentInfo , this . result . location . get ( 'contentInfo' ) , 'item should have a location' ) ;
313
313
} ,
314
+
315
+ "Should remove loading after updating items" : function ( ) {
316
+ var container = this . view . get ( 'container' ) ;
317
+
318
+ container . addClass ( 'is-loading' ) ;
319
+ this . view . set ( 'items' , this . searchResult ) ;
320
+
321
+ Assert . isFalse ( container . hasClass ( 'is-loading' ) , 'Should have the loading icon' ) ;
322
+ } ,
314
323
} ) ;
315
324
316
325
scrollTest = new Y . Test . Case ( {
@@ -451,24 +460,11 @@ YUI.add('ez-universaldiscoveryfinderexplorerlevelview-tests', function (Y) {
451
460
delete this . view ;
452
461
} ,
453
462
454
- "Should set items to null and add loading class on reset" : function ( ) {
455
- var container = this . view . get ( 'container' ) ;
456
-
463
+ "Should set items to null on reset" : function ( ) {
457
464
this . view . set ( 'items' , this . searchResult ) ;
458
465
this . view . reset ( ) ;
459
- Assert . isTrue ( container . hasClass ( 'is-loading' ) , 'Should have the loading icon' ) ;
460
466
Assert . isNull ( this . view . get ( 'items' ) , 'items attribute should be resetted' ) ;
461
467
} ,
462
-
463
- "Should add loading class when setting items to null" : function ( ) {
464
- var container = this . view . get ( 'container' ) ;
465
-
466
- this . view . set ( 'items' , this . searchResult ) ;
467
- Assert . isFalse ( container . hasClass ( 'is-loading' ) , 'Should NOT have the loading icon' ) ;
468
-
469
- this . view . set ( 'items' , null ) ;
470
- Assert . isTrue ( container . hasClass ( 'is-loading' ) , 'Should have the loading icon' ) ;
471
- } ,
472
468
} ) ;
473
469
474
470
Y . Test . Runner . setName ( "eZ Universal Discovery Finder Explorer Level View tests" ) ;
0 commit comments