@@ -13,14 +13,14 @@ describe('Tab', () => {
13
13
14
14
describe ( 'simple' , ( ) => {
15
15
it ( 'should render only one tab' , ( ) => {
16
- const wrapper = mount ( < Tab > < Tab . Item title = "foo" /> </ Tab > )
16
+ const wrapper = mount ( < Tab > < Tab . Item title = "foo" /> </ Tab > ) ;
17
17
assert ( wrapper . find ( '.next-tabs-tab' ) . length === 1 ) ;
18
- } )
18
+ } ) ;
19
19
} ) ;
20
20
21
21
describe ( 'with props' , ( ) => {
22
22
let wrapper ;
23
- const panes = [ 1 , 2 , 3 , 4 ] . map ( ( item , index ) => < Tab . Item title = { `item ${ item } ` } key = { index } > </ Tab . Item > ) ;
23
+ const panes = [ 1 , 2 , 3 , 4 , 5 ] . map ( ( item , index ) => item < 5 ? < Tab . Item title = { `item ${ item } ` } key = { index } > </ Tab . Item > : null ) ;
24
24
25
25
afterEach ( ( ) => {
26
26
wrapper . unmount ( ) ;
@@ -68,7 +68,7 @@ describe('Tab', () => {
68
68
const wrapper2 = mount ( < Tab tabPosition = "right" shape = "wrapped" > { panes } </ Tab > ) ;
69
69
assert ( wrapper2 . find ( '.next-tabs' ) . hasClass ( 'next-tabs-vertical' ) ) ;
70
70
71
- const wrapper3 = mount ( < Tab tabPosition = "bottom" shape = "wrapped" > { panes } </ Tab > )
71
+ const wrapper3 = mount ( < Tab tabPosition = "bottom" shape = "wrapped" > { panes } </ Tab > ) ;
72
72
assert ( wrapper3 . find ( '.next-tabs' ) . hasClass ( 'next-tabs-bottom' ) ) ;
73
73
} ) ;
74
74
@@ -83,7 +83,7 @@ describe('Tab', () => {
83
83
} ) ;
84
84
85
85
it ( 'should render extra in left side' , ( ) => {
86
- wrapper = mount ( < Tab shape = "wrapped" tabPosition = "left" extra = { < button className = "test-extra" > hello world</ button > } > { panes } </ Tab > )
86
+ wrapper = mount ( < Tab shape = "wrapped" tabPosition = "left" extra = { < button className = "test-extra" > hello world</ button > } > { panes } </ Tab > ) ;
87
87
assert ( wrapper . find ( '.test-extra' ) . length === 1 ) ;
88
88
} ) ;
89
89
@@ -96,15 +96,15 @@ describe('Tab', () => {
96
96
} ) ;
97
97
98
98
it ( 'should render with contentStyle & contentClassName' , ( ) => {
99
- const contentStyle = { background : 'red' } ;
99
+ const contentStyle = { background : 'red' } ;
100
100
wrapper = mount ( < Tab contentStyle = { contentStyle } contentClassName = "custom-content" > { panes } </ Tab > ) ;
101
101
assert ( wrapper . find ( '.next-tabs-content' ) . hasClass ( 'custom-content' ) ) ;
102
102
const tabContent = wrapper . find ( '.next-tabs-content' ) . instance ( ) ;
103
103
assert ( tabContent . style . background === 'red' || tabContent . style . background . startsWith ( 'red' ) ) ;
104
104
} ) ;
105
105
106
106
it ( 'should render with tabRender' , ( ) => {
107
- wrapper = mount ( < Tab tabRender = { ( key , props ) => < div className = "custom-tab-item" > { props . title } </ div > } > { panes } </ Tab > )
107
+ wrapper = mount ( < Tab tabRender = { ( key , props ) => < div className = "custom-tab-item" > { props . title } </ div > } > { panes } </ Tab > ) ;
108
108
assert ( wrapper . find ( '.custom-tab-item' ) . length === 4 ) ;
109
109
} ) ;
110
110
@@ -162,7 +162,7 @@ describe('Tab', () => {
162
162
wrapper = mount ( < Tab onClose = { key => tabKey = key } >
163
163
< Tab . Item title = "foo" />
164
164
< Tab . Item title = "bar" closeable />
165
- </ Tab > )
165
+ </ Tab > ) ;
166
166
const closeIcon = wrapper . find ( '.next-icon-close' ) ;
167
167
assert ( closeIcon . length === 1 ) ;
168
168
closeIcon . simulate ( 'click' ) ;
@@ -222,7 +222,7 @@ describe('Tab', () => {
222
222
it ( 'should scrollToActiveTab' , ( ) => {
223
223
wrapper = mount ( < div style = { boxStyle } > < Tab activeKey = "9" > { panes } </ Tab > </ div > , { attachTo : target } ) ;
224
224
// console.log(wrapper.find('.next-tabs').instance());
225
- wrapper . setProps ( { activeKey : "3" } ) ;
225
+ wrapper . setProps ( { activeKey : '3' } ) ;
226
226
// wrapper.find('.next-tabs-tab').at(1).simulate('click');
227
227
228
228
} ) ;
0 commit comments