@@ -61,10 +61,10 @@ describe('tabs', function() {
61
61
it ( 'should create clickable titles' , function ( ) {
62
62
var t = titles ( ) ;
63
63
expect ( t . length ) . toBe ( 2 ) ;
64
- expect ( t . find ( 'a ' ) . eq ( 0 ) . text ( ) ) . toBe ( 'First Tab 1' ) ;
64
+ expect ( t . find ( '> div ' ) . eq ( 0 ) . text ( ) ) . toBe ( 'First Tab 1' ) ;
65
65
//It should put the uib-tab-heading element into the 'a' title
66
- expect ( t . find ( 'a ' ) . eq ( 1 ) . children ( ) . is ( 'uib-tab-heading' ) ) . toBe ( true ) ;
67
- expect ( t . find ( 'a ' ) . eq ( 1 ) . children ( ) . html ( ) ) . toBe ( '<b>Second</b> Tab 2' ) ;
66
+ expect ( t . find ( '> div ' ) . eq ( 1 ) . children ( ) . is ( 'uib-tab-heading' ) ) . toBe ( true ) ;
67
+ expect ( t . find ( '> div ' ) . eq ( 1 ) . children ( ) . html ( ) ) . toBe ( '<b>Second</b> Tab 2' ) ;
68
68
} ) ;
69
69
70
70
it ( 'should bind tabs content and set first tab active' , function ( ) {
@@ -76,7 +76,7 @@ describe('tabs', function() {
76
76
} ) ;
77
77
78
78
it ( 'should change active on click' , function ( ) {
79
- titles ( ) . eq ( 1 ) . find ( 'a ' ) . click ( ) ;
79
+ titles ( ) . eq ( 1 ) . find ( '> div ' ) . click ( ) ;
80
80
expect ( contents ( ) . eq ( 1 ) ) . toHaveClass ( 'active' ) ;
81
81
expect ( titles ( ) . eq ( 0 ) ) . not . toHaveClass ( 'active' ) ;
82
82
expect ( titles ( ) . eq ( 1 ) ) . toHaveClass ( 'active' ) ;
@@ -85,17 +85,17 @@ describe('tabs', function() {
85
85
} ) ;
86
86
87
87
it ( 'should call select callback on select' , function ( ) {
88
- titles ( ) . eq ( 1 ) . find ( 'a ' ) . click ( ) ;
88
+ titles ( ) . eq ( 1 ) . find ( '> div ' ) . click ( ) ;
89
89
expect ( scope . selectSecond ) . toHaveBeenCalled ( ) ;
90
- titles ( ) . eq ( 0 ) . find ( 'a ' ) . click ( ) ;
90
+ titles ( ) . eq ( 0 ) . find ( '> div ' ) . click ( ) ;
91
91
expect ( scope . selectFirst ) . toHaveBeenCalled ( ) ;
92
92
} ) ;
93
93
94
94
it ( 'should call deselect callback on deselect' , function ( ) {
95
- titles ( ) . eq ( 1 ) . find ( 'a ' ) . click ( ) ;
96
- titles ( ) . eq ( 0 ) . find ( 'a ' ) . click ( ) ;
95
+ titles ( ) . eq ( 1 ) . find ( '> div ' ) . click ( ) ;
96
+ titles ( ) . eq ( 0 ) . find ( '> div ' ) . click ( ) ;
97
97
expect ( scope . deselectSecond ) . toHaveBeenCalled ( ) ;
98
- titles ( ) . eq ( 1 ) . find ( 'a ' ) . click ( ) ;
98
+ titles ( ) . eq ( 1 ) . find ( '> div ' ) . click ( ) ;
99
99
expect ( scope . deselectFirst ) . toHaveBeenCalled ( ) ;
100
100
} ) ;
101
101
} ) ;
@@ -181,13 +181,13 @@ describe('tabs', function() {
181
181
execOrder = [ ] ;
182
182
183
183
// Select second tab
184
- titles ( ) . eq ( 1 ) . find ( 'a ' ) . click ( ) ;
184
+ titles ( ) . eq ( 1 ) . find ( '> div ' ) . click ( ) ;
185
185
expect ( execOrder ) . toEqual ( [ 'deselect1' , 'select2' ] ) ;
186
186
187
187
execOrder = [ ] ;
188
188
189
189
// Select again first tab
190
- titles ( ) . eq ( 0 ) . find ( 'a ' ) . click ( ) ;
190
+ titles ( ) . eq ( 0 ) . find ( '> div ' ) . click ( ) ;
191
191
expect ( execOrder ) . toEqual ( [ 'deselect2' , 'select1' ] ) ;
192
192
} ) ;
193
193
} ) ;
@@ -250,7 +250,7 @@ describe('tabs', function() {
250
250
} ) ;
251
251
252
252
it ( 'should switch active when clicking' , function ( ) {
253
- titles ( ) . eq ( 3 ) . find ( 'a ' ) . click ( ) ;
253
+ titles ( ) . eq ( 3 ) . find ( '> div ' ) . click ( ) ;
254
254
expectTabActive ( scope . tabs [ 3 ] ) ;
255
255
} ) ;
256
256
@@ -317,7 +317,7 @@ describe('tabs', function() {
317
317
} ) ) ;
318
318
319
319
function heading ( ) {
320
- return elm . find ( 'ul li a ' ) . children ( ) ;
320
+ return elm . find ( 'ul li > div ' ) . children ( ) ;
321
321
}
322
322
323
323
it ( 'should create a heading bound to myHtml' , function ( ) {
@@ -379,7 +379,7 @@ describe('tabs', function() {
379
379
380
380
it ( 'should preserve correct ordering' , function ( ) {
381
381
function titles ( ) {
382
- return elm . find ( 'ul.nav-tabs li a ' ) ;
382
+ return elm . find ( 'ul.nav-tabs li > div ' ) ;
383
383
}
384
384
scope . $apply ( ) ;
385
385
expect ( titles ( ) . length ) . toBe ( 9 ) ;
@@ -522,7 +522,7 @@ describe('tabs', function() {
522
522
expectContents ( [ 'Hello' , 'content 1' , 'content 2' , 'content 3' ] ) ;
523
523
524
524
// Select last tab
525
- titles ( ) . find ( 'a ' ) . eq ( 3 ) . click ( ) ;
525
+ titles ( ) . find ( '> div ' ) . eq ( 3 ) . click ( ) ;
526
526
expect ( contents ( ) . eq ( 3 ) ) . toHaveClass ( 'active' ) ;
527
527
expect ( titles ( ) . eq ( 3 ) ) . toHaveClass ( 'active' ) ;
528
528
@@ -536,7 +536,7 @@ describe('tabs', function() {
536
536
expect ( contents ( ) . eq ( 2 ) ) . toHaveClass ( 'active' ) ;
537
537
538
538
// Select 2nd tab ("tab 1")
539
- titles ( ) . find ( 'a ' ) . eq ( 1 ) . click ( ) ;
539
+ titles ( ) . find ( '> div ' ) . eq ( 1 ) . click ( ) ;
540
540
expect ( titles ( ) . eq ( 1 ) ) . toHaveClass ( 'active' ) ;
541
541
expect ( contents ( ) . eq ( 1 ) ) . toHaveClass ( 'active' ) ;
542
542
@@ -632,10 +632,10 @@ describe('tabs', function() {
632
632
}
633
633
634
634
it ( 'should not switch active when clicking on title' , function ( ) {
635
- titles ( ) . eq ( 2 ) . find ( 'a ' ) . click ( ) ;
635
+ titles ( ) . eq ( 2 ) . find ( '> div ' ) . click ( ) ;
636
636
expectTabActive ( scope . tabs [ 2 ] ) ;
637
637
638
- titles ( ) . eq ( 3 ) . find ( 'a ' ) . click ( ) ;
638
+ titles ( ) . eq ( 3 ) . find ( '> div ' ) . click ( ) ;
639
639
expectTabActive ( scope . tabs [ 2 ] ) ;
640
640
} ) ;
641
641
0 commit comments