@@ -11,16 +11,16 @@ test('Basic usage', () => {
1111 </ Switch >
1212 ) ;
1313
14- expect ( switch1 . find ( 'div .el-switch__label' ) . at ( 0 ) . text ( ) ) . toEqual ( '' ) ;
15- expect ( switch1 . find ( 'div .el-switch__label' ) . at ( 1 ) . text ( ) ) . toEqual ( '' ) ;
16- expect ( switch1 . find ( 'label .el-switch' ) . at ( 0 ) . hasClass ( 'is-checked' ) ) . toEqual ( true ) ;
14+ expect ( switch1 . find ( 'label.el-switch .el-switch__label' ) . at ( 0 ) . text ( ) ) . toEqual ( '' ) ;
15+ expect ( switch1 . find ( 'label.el-switch .el-switch__label' ) . at ( 1 ) . text ( ) ) . toEqual ( '' ) ;
16+ expect ( switch1 . find ( 'label.el-switch' ) . hasClass ( 'is-checked' ) ) . toEqual ( true ) ;
1717
1818 // switch off
1919 switch1 . find ( 'input' ) . simulate ( 'change' , { target : { value : false } } ) ;
2020
21- expect ( switch1 . find ( 'div .el-switch__label' ) . at ( 0 ) . text ( ) ) . toEqual ( '' ) ;
22- expect ( switch1 . find ( 'div .el-switch__label' ) . at ( 1 ) . text ( ) ) . toEqual ( '' ) ;
23- expect ( switch1 . find ( 'label .el-switch' ) . at ( 0 ) . hasClass ( 'is-checked' ) ) . toEqual ( false ) ;
21+ expect ( switch1 . find ( 'label.el-switch .el-switch__label' ) . at ( 0 ) . text ( ) ) . toEqual ( '' ) ;
22+ expect ( switch1 . find ( 'label.el-switch .el-switch__label' ) . at ( 1 ) . text ( ) ) . toEqual ( '' ) ;
23+ expect ( switch1 . find ( 'label.el-switch' ) . at ( 0 ) . hasClass ( 'is-checked' ) ) . toEqual ( false ) ;
2424
2525 const switch2 = mount (
2626 < Switch
@@ -30,20 +30,21 @@ test('Basic usage', () => {
3030 </ Switch >
3131 ) ;
3232
33- expect ( switch2 . find ( 'label .el-switch' ) . at ( 0 ) . hasClass ( 'is-checked' ) ) . toEqual ( true ) ;
34- expect ( switch2 . find ( 'div .el-switch__label' ) . at ( 0 ) . text ( ) ) . toEqual ( 'ON' ) ;
35- expect ( switch2 . find ( 'div .el-switch__label' ) . at ( 1 ) . text ( ) ) . toEqual ( 'OFF' ) ;
36- expect ( switch2 . find ( 'div .el-switch__label' ) . at ( 0 ) . prop ( 'style' ) . display ) . toEqual ( undefined ) ;
37- expect ( switch2 . find ( 'div .el-switch__label' ) . at ( 1 ) . prop ( 'style' ) . display ) . toEqual ( 'none' ) ;
33+ expect ( switch2 . find ( 'label.el-switch' ) . at ( 0 ) . hasClass ( 'is-checked' ) ) . toEqual ( true ) ;
34+ expect ( switch2 . find ( 'label.el-switch .el-switch__label' ) . at ( 0 ) . text ( ) ) . toEqual ( 'ON' ) ;
35+ expect ( switch2 . find ( 'label.el-switch .el-switch__label' ) . at ( 1 ) . text ( ) ) . toEqual ( 'OFF' ) ;
36+ expect ( switch2 . find ( 'label.el-switch .el-switch__label' ) . at ( 0 ) . prop ( 'style' ) . display ) . toEqual ( undefined ) ;
37+ expect ( switch2 . find ( 'label.el-switch .el-switch__label' ) . at ( 1 ) . prop ( 'style' ) . display ) . toEqual ( 'none' ) ;
3838
3939 // switch off
4040 switch2 . find ( 'input[type="checkbox"]' ) . simulate ( 'change' , { target : { value : false } } ) ;
4141
42- expect ( switch2 . find ( 'label .el-switch' ) . at ( 0 ) . hasClass ( 'is-checked' ) ) . toEqual ( false ) ;
43- expect ( switch2 . find ( 'div .el-switch__label' ) . at ( 0 ) . text ( ) ) . toEqual ( 'ON' ) ;
44- expect ( switch2 . find ( 'div .el-switch__label' ) . at ( 1 ) . text ( ) ) . toEqual ( 'OFF' ) ;
45- expect ( switch2 . find ( 'div .el-switch__label' ) . at ( 0 ) . prop ( 'style' ) . display ) . toEqual ( 'none' ) ;
46- expect ( switch2 . find ( 'div .el-switch__label' ) . at ( 1 ) . prop ( 'style' ) . display ) . toEqual ( undefined ) ;
42+ expect ( switch2 . find ( 'label.el-switch' ) . at ( 0 ) . hasClass ( 'is-checked' ) ) . toEqual ( false ) ;
43+ expect ( switch2 . find ( 'label.el-switch .el-switch__label' ) . at ( 0 ) . text ( ) ) . toEqual ( 'ON' ) ;
44+ expect ( switch2 . find ( 'label.el-switch .el-switch__label' ) . at ( 1 ) . text ( ) ) . toEqual ( 'OFF' ) ;
45+ expect ( switch2 . find ( 'label.el-switch .el-switch__label' ) . at ( 0 ) . prop ( 'style' ) . display ) . toEqual ( 'none' ) ;
46+ expect ( switch2 . find ( 'label.el-switch .el-switch__label' ) . at ( 1 ) . prop ( 'style' ) . display ) . toEqual ( undefined ) ;
47+
4748} ) ;
4849
4950test ( 'Extended value types' , ( ) => {
@@ -73,7 +74,7 @@ test('Extended value types', () => {
7374 </ Tooltip >
7475 </ div > ) ;
7576
76- expect ( component . find ( 'label .el-switch .el-switch--wide' ) . at ( 0 ) . hasClass ( 'is-checked' ) ) . toEqual ( true ) ;
77+ expect ( component . find ( 'label.el-switch.el-switch--wide' ) . at ( 0 ) . hasClass ( 'is-checked' ) ) . toEqual ( true ) ;
7778 expect ( component . find ( 'div .el-switch__label' ) . at ( 0 ) . text ( ) ) . toEqual ( 'ON' ) ;
7879 expect ( component . find ( 'div .el-switch__label' ) . at ( 1 ) . text ( ) ) . toEqual ( 'OFF' ) ;
7980 expect ( component . find ( 'div .el-switch__label' ) . at ( 0 ) . prop ( 'style' ) . display ) . toEqual ( undefined ) ;
@@ -83,7 +84,7 @@ test('Extended value types', () => {
8384 // switch off
8485 component . find ( 'input[type="checkbox"]' ) . simulate ( 'change' , { target : { value : false } } ) ;
8586
86- expect ( component . find ( 'label .el-switch .el-switch--wide' ) . at ( 0 ) . hasClass ( 'is-checked' ) ) . toEqual ( false ) ;
87+ expect ( component . find ( 'label.el-switch.el-switch--wide' ) . at ( 0 ) . hasClass ( 'is-checked' ) ) . toEqual ( false ) ;
8788 expect ( component . find ( 'div .el-switch__label' ) . at ( 0 ) . text ( ) ) . toEqual ( 'ON' ) ;
8889 expect ( component . find ( 'div .el-switch__label' ) . at ( 1 ) . text ( ) ) . toEqual ( 'OFF' ) ;
8990 expect ( component . find ( 'div .el-switch__label' ) . at ( 0 ) . prop ( 'style' ) . display ) . toEqual ( 'none' ) ;
@@ -101,7 +102,7 @@ test('Disabled', () => {
101102 </ Switch >
102103 ) ;
103104
104- expect ( switch1 . find ( 'label .el-switch' ) . at ( 0 ) . hasClass ( 'is-disabled' ) ) . toEqual ( true ) ;
105+ expect ( switch1 . find ( 'label.el-switch' ) . at ( 0 ) . hasClass ( 'is-disabled' ) ) . toEqual ( true ) ;
105106 expect ( switch1 . find ( 'input[type="checkbox"]' ) . at ( 0 ) . prop ( 'disabled' ) ) . toEqual ( true ) ;
106107
107108 const switch2 = mount (
@@ -110,7 +111,7 @@ test('Disabled', () => {
110111 disabled >
111112 </ Switch > ) ;
112113
113- expect ( switch2 . find ( 'label .el-switch' ) . at ( 0 ) . hasClass ( 'is-disabled' ) ) . toEqual ( true ) ;
114+ expect ( switch2 . find ( 'label.el-switch' ) . at ( 0 ) . hasClass ( 'is-disabled' ) ) . toEqual ( true ) ;
114115 expect ( switch2 . find ( 'input[type="checkbox"]' ) . at ( 0 ) . prop ( 'disabled' ) ) . toEqual ( true ) ;
115116
116117} ) ;
0 commit comments