@@ -80,4 +80,48 @@ describe('Tabs', () => {
8080 expect ( nav . children [ 0 ] . firstChild ) . not . toHaveClass ( 'active' ) ;
8181 expect ( nav . children [ 1 ] . firstChild ) . toHaveClass ( 'active' ) ;
8282 } ) ;
83+
84+ test ( 'checks if inline styles from "tab_style", "active_tab_style", "label_style" and "active_label_style" are consistent' , ( ) => {
85+ const tabStyle = { backgroundColor : '#fff' , borderRadius : '20px' } ;
86+ const activeTabStyle = { backgroundColor : '#000' } ;
87+ const labelStyle = { color : '#000' , textDecoration : 'underline' } ;
88+ const activeLabelStyle = { color : '#fff' } ;
89+
90+ const { container} = render (
91+ < Tabs active_tab = "tab-2" >
92+ < Tab
93+ tab_id = "tab-1"
94+ label = "tab-label-1"
95+ tab_style = { tabStyle }
96+ active_tab_style = { activeTabStyle }
97+ label_style = { labelStyle }
98+ active_label_style = { activeLabelStyle }
99+ >
100+ tab-content-1
101+ </ Tab >
102+ < Tab
103+ tab_id = "tab-2"
104+ label = "tab-label-2"
105+ tab_style = { tabStyle }
106+ active_tab_style = { activeTabStyle }
107+ label_style = { labelStyle }
108+ active_label_style = { activeLabelStyle }
109+ >
110+ tab-content-2
111+ </ Tab >
112+ </ Tabs >
113+ ) ;
114+ const nav = container . querySelector ( 'ul.nav.nav-tabs' ) ;
115+
116+ expect ( nav . children [ 0 ] ) . toHaveStyle ( tabStyle ) ;
117+ expect ( nav . children [ 0 ] . firstChild ) . toHaveStyle ( labelStyle ) ;
118+ expect ( nav . children [ 1 ] ) . toHaveStyle ( {
119+ backgroundColor : '#000' ,
120+ borderRadius : '20px'
121+ } ) ;
122+ expect ( nav . children [ 1 ] . firstChild ) . toHaveStyle ( {
123+ color : '#fff' ,
124+ textDecoration : 'underline'
125+ } ) ;
126+ } ) ;
83127} ) ;
0 commit comments