@@ -34,20 +34,41 @@ describe('FormGroup', () => {
3434 expect ( wrapper . hasClass ( 'form-check' ) ) . toBe ( true ) ;
3535 } ) ;
3636
37+ it ( 'should render with "form-check" and "form-switch" class when switch prop is truthy' , ( ) => {
38+ const wrapper = shallow ( < FormGroup switch > Yo!</ FormGroup > ) ;
39+
40+ expect ( wrapper . hasClass ( 'form-check' ) ) . toBe ( true ) ;
41+ expect ( wrapper . hasClass ( 'form-switch' ) ) . toBe ( true ) ;
42+ } ) ;
43+
3744 it ( 'should not render with "form-check-inline" class when check prop is truthy and inline prop is falsy' , ( ) => {
3845 const wrapper = shallow ( < FormGroup check > Yo!</ FormGroup > ) ;
3946
4047 expect ( wrapper . hasClass ( 'form-check-inline' ) ) . toBe ( false ) ;
4148 } ) ;
4249
50+ it ( 'should not render with "form-check-inline" class when switch prop is truthy and inline prop is falsy' , ( ) => {
51+ const wrapper = shallow ( < FormGroup switch > Yo!</ FormGroup > ) ;
52+
53+ expect ( wrapper . hasClass ( 'form-check-inline' ) ) . toBe ( false ) ;
54+ } ) ;
55+
4356 it ( 'should render with "form-check" and "form-check-inline" classes when check prop and inline prop are both truthy' , ( ) => {
4457 const wrapper = shallow ( < FormGroup check inline > Yo!</ FormGroup > ) ;
4558
4659 expect ( wrapper . hasClass ( 'form-check' ) ) . toBe ( true ) ;
4760 expect ( wrapper . hasClass ( 'form-check-inline' ) ) . toBe ( true ) ;
4861 } ) ;
4962
50- it ( 'should not render with "form-check-inline" class when check prop is falsy and inline prop is truthy' , ( ) => {
63+ it ( 'should render with "form-check" and "form-switch" and "form-check-inline" classes when check prop and inline prop are both truthy' , ( ) => {
64+ const wrapper = shallow ( < FormGroup switch inline > Yo!</ FormGroup > ) ;
65+
66+ expect ( wrapper . hasClass ( 'form-check' ) ) . toBe ( true ) ;
67+ expect ( wrapper . hasClass ( 'form-switch' ) ) . toBe ( true ) ;
68+ expect ( wrapper . hasClass ( 'form-check-inline' ) ) . toBe ( true ) ;
69+ } ) ;
70+
71+ it ( 'should not render with "form-check-inline" class when check and switch prop are falsy and inline prop is truthy' , ( ) => {
5172 const wrapper = shallow ( < FormGroup inline > Yo!</ FormGroup > ) ;
5273
5374 expect ( wrapper . hasClass ( 'form-check-inline' ) ) . toBe ( false ) ;
@@ -59,7 +80,13 @@ describe('FormGroup', () => {
5980 expect ( wrapper . hasClass ( 'mb-3' ) ) . toBe ( false ) ;
6081 } ) ;
6182
62- it ( 'should not render with "disabled" class when disabled prop is truthy but check is not' , ( ) => {
83+ it ( 'should not render with "mb-3" class when switch prop is truthy' , ( ) => {
84+ const wrapper = shallow ( < FormGroup switch > Yo!</ FormGroup > ) ;
85+
86+ expect ( wrapper . hasClass ( 'mb-3' ) ) . toBe ( false ) ;
87+ } ) ;
88+
89+ it ( 'should not render with "disabled" class when disabled prop is truthy but check and switch are not' , ( ) => {
6390 const wrapper = shallow ( < FormGroup disabled > Yo!</ FormGroup > ) ;
6491
6592 expect ( wrapper . hasClass ( 'disabled' ) ) . toBe ( false ) ;
@@ -72,6 +99,13 @@ describe('FormGroup', () => {
7299 expect ( wrapper . hasClass ( 'form-check' ) ) . toBe ( true ) ;
73100 } ) ;
74101
102+ it ( 'should render with "disabled" class when both switch and disabled props are truthy' , ( ) => {
103+ const wrapper = shallow ( < FormGroup switch disabled > Yo!</ FormGroup > ) ;
104+
105+ expect ( wrapper . hasClass ( 'disabled' ) ) . toBe ( true ) ;
106+ expect ( wrapper . hasClass ( 'form-check' ) ) . toBe ( true ) ;
107+ } ) ;
108+
75109 it ( 'should render with "row" class when row prop is truthy' , ( ) => {
76110 const wrapper = shallow ( < FormGroup row > Yo!</ FormGroup > ) ;
77111
0 commit comments