File tree 2 files changed +45
-0
lines changed
2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head > </ head >
4
+ < body >
5
+ < ul >
6
+ < li > < a href ="#tab-1 "> Tab 1</ a > </ li >
7
+ < li > < a href ="#tab-2 "> Tab 2</ a > </ li >
8
+ < li > < a href ="#tab-3 "> Tab 3</ a > </ li >
9
+ < li > < a href ="#tab-n "> Tab N</ a > </ li >
10
+ </ ul >
11
+ < div class ="tabscontent ">
12
+ < a href ="#tab-1 "> Tab 1</ a >
13
+ < div class ="tabcontent-element " id ="tab-1 ">
14
+ First tab content
15
+ </ div >
16
+ < a href ="#tab-2 "> Tab 2</ a >
17
+ < div class ="tabcontent-element " id ="tab-2 ">
18
+ Second tab content
19
+ </ div >
20
+ < a href ="#tab-3 "> Tab 3</ a >
21
+ < div class ="tabcontent-element " id ="tab-3 ">
22
+ Third tab content
23
+ </ div >
24
+ < a href ="#tab-4 "> Tab 4</ a >
25
+ < div class ="tabcontent-element " id ="tab-n ">
26
+ Fourth tab content
27
+ </ div >
28
+ </ div >
29
+ </ body >
30
+ </ html >
Original file line number Diff line number Diff line change @@ -27,6 +27,21 @@ describe('$.fn.tabbedContent', () => {
27
27
28
28
done ( )
29
29
} )
30
+
31
+ it ( 'hides all contents except for the first tab and non content elements' , ( done ) => {
32
+ loadFixtures ( 'fixture2.html' ) ;
33
+ $ ( '.tabscontent' ) . tabbedContent ( { "contentElements" : ".tabcontent-element" } ) ;
34
+
35
+ expect ( $ ( '#tab-1' ) ) . toBeVisible ( )
36
+ expect ( $ ( '#tab-2' ) ) . not . toBeVisible ( )
37
+ expect ( $ ( '#tab-3' ) ) . not . toBeVisible ( )
38
+ expect ( $ ( '#tab-n' ) ) . not . toBeVisible ( )
39
+ expect ( $ ( '.tabscontent a:eq(0)' ) ) . toBeVisible ( )
40
+ expect ( $ ( '.tabscontent a:eq(1)' ) ) . toBeVisible ( )
41
+ expect ( $ ( '.tabscontent a:eq(2)' ) ) . toBeVisible ( )
42
+ expect ( $ ( '.tabscontent a:eq(3)' ) ) . toBeVisible ( )
43
+ done ( ) ;
44
+ } )
30
45
} )
31
46
32
47
describe ( 'events' , ( ) => {
You can’t perform that action at this time.
0 commit comments