@@ -225,29 +225,11 @@ describe('dropdownToggle', function() {
225
225
expect ( $document . find ( '#dropdown-menu' ) . parent ( ) [ 0 ] ) . toBe ( $document . find ( 'body' ) [ 0 ] ) ;
226
226
} ) ;
227
227
228
- it ( 'adds the dropdown class to the body' , function ( ) {
229
- expect ( $document . find ( 'body' ) . hasClass ( 'dropdown' ) ) . toBe ( true ) ;
230
- } ) ;
231
-
232
228
it ( 'removes the menu when the dropdown is removed' , function ( ) {
233
229
element . remove ( ) ;
234
230
$rootScope . $digest ( ) ;
235
231
expect ( $document . find ( '#dropdown-menu' ) . length ) . toEqual ( 0 ) ;
236
232
} ) ;
237
-
238
- it ( 'toggles the open class on body' , function ( ) {
239
- var body = $document . find ( 'body' ) ;
240
-
241
- expect ( body . hasClass ( 'open' ) ) . toBe ( false ) ;
242
-
243
- element . find ( '[uib-dropdown-toggle]' ) . click ( ) ;
244
-
245
- expect ( body . hasClass ( 'open' ) ) . toBe ( true ) ;
246
-
247
- element . find ( '[uib-dropdown-toggle]' ) . click ( ) ;
248
-
249
- expect ( body . hasClass ( 'open' ) ) . toBe ( false ) ;
250
- } ) ;
251
233
} ) ;
252
234
253
235
describe ( 'integration with $location URL rewriting' , function ( ) {
@@ -455,12 +437,11 @@ describe('dropdownToggle', function() {
455
437
it ( 'should work with dropdown-append-to-body' , function ( ) {
456
438
element = $compile ( '<li uib-dropdown dropdown-append-to-body auto-close="outsideClick"><a href uib-dropdown-toggle></a><ul class="uib-dropdown-menu" id="dropdown-menu"><li><a href>Hello On Body</a></li></ul></li>' ) ( $rootScope ) ;
457
439
clickDropdownToggle ( ) ;
458
- var body = $document . find ( 'body' ) ;
459
- expect ( body . hasClass ( dropdownConfig . openClass ) ) . toBe ( true ) ;
440
+ expect ( element . hasClass ( dropdownConfig . openClass ) ) . toBe ( true ) ;
460
441
$document . find ( '#dropdown-menu' ) . find ( 'li' ) . eq ( 0 ) . trigger ( 'click' ) ;
461
- expect ( body . hasClass ( dropdownConfig . openClass ) ) . toBe ( true ) ;
442
+ expect ( element . hasClass ( dropdownConfig . openClass ) ) . toBe ( true ) ;
462
443
$document . click ( ) ;
463
- expect ( body . hasClass ( dropdownConfig . openClass ) ) . toBe ( false ) ;
444
+ expect ( element . hasClass ( dropdownConfig . openClass ) ) . toBe ( false ) ;
464
445
} ) ;
465
446
} ) ;
466
447
@@ -686,7 +667,7 @@ describe('dropdownToggle', function() {
686
667
687
668
triggerKeyDown ( element , 40 ) ;
688
669
689
- expect ( $document . find ( 'body' ) . hasClass ( dropdownConfig . openClass ) ) . toBe ( true ) ;
670
+ expect ( element . hasClass ( dropdownConfig . openClass ) ) . toBe ( true ) ;
690
671
var focusEl = $document . find ( 'ul' ) . eq ( 0 ) . find ( 'a' ) ;
691
672
expect ( isFocused ( focusEl ) ) . toBe ( true ) ;
692
673
} ) ;
@@ -696,7 +677,7 @@ describe('dropdownToggle', function() {
696
677
triggerKeyDown ( element , 40 ) ;
697
678
triggerKeyDown ( element , 40 ) ;
698
679
699
- expect ( $document . find ( 'body' ) . hasClass ( dropdownConfig . openClass ) ) . toBe ( true ) ;
680
+ expect ( element . hasClass ( dropdownConfig . openClass ) ) . toBe ( true ) ;
700
681
var elem1 = $document . find ( 'ul' ) ;
701
682
var elem2 = elem1 . find ( 'a' ) ;
702
683
var focusEl = $document . find ( 'ul' ) . eq ( 0 ) . find ( 'a' ) . eq ( 1 ) ;
0 commit comments