@@ -74,28 +74,28 @@ describe('<Switch />', () => {
7474 expect ( root . childNodes [ 1 ] ) . to . have . class ( classes . track ) ;
7575 } ) ;
7676
77- it ( 'renders a `role="checkbox "` with the Unchecked state by default' , ( ) => {
77+ it ( 'renders a `role="switch "` with the Unchecked state by default' , ( ) => {
7878 const { getByRole } = render ( < Switch /> ) ;
7979
80- expect ( getByRole ( 'checkbox ' ) ) . to . have . property ( 'checked' , false ) ;
80+ expect ( getByRole ( 'switch ' ) ) . to . have . property ( 'checked' , false ) ;
8181 } ) ;
8282
83- it ( 'renders a checkbox with the Checked state when checked' , ( ) => {
83+ it ( 'renders a switch with the Checked state when checked' , ( ) => {
8484 const { getByRole } = render ( < Switch defaultChecked /> ) ;
8585
86- expect ( getByRole ( 'checkbox ' ) ) . to . have . property ( 'checked' , true ) ;
86+ expect ( getByRole ( 'switch ' ) ) . to . have . property ( 'checked' , true ) ;
8787 } ) ;
8888
8989 specify ( 'the switch can be disabled' , ( ) => {
9090 const { getByRole } = render ( < Switch disabled /> ) ;
9191
92- expect ( getByRole ( 'checkbox ' ) ) . to . have . property ( 'disabled' , true ) ;
92+ expect ( getByRole ( 'switch ' ) ) . to . have . property ( 'disabled' , true ) ;
9393 } ) ;
9494
9595 specify ( 'the switch can be readonly' , ( ) => {
9696 const { getByRole } = render ( < Switch readOnly /> ) ;
9797
98- expect ( getByRole ( 'checkbox ' ) ) . to . have . property ( 'readOnly' , true ) ;
98+ expect ( getByRole ( 'switch ' ) ) . to . have . property ( 'readOnly' , true ) ;
9999 } ) ;
100100
101101 specify ( 'renders a custom icon when provided' , ( ) => {
@@ -117,11 +117,11 @@ describe('<Switch />', () => {
117117
118118 // how a user would trigger it
119119 act ( ( ) => {
120- getByRole ( 'checkbox ' ) . click ( ) ;
121- fireEvent . change ( getByRole ( 'checkbox ' ) , { target : { checked : '' } } ) ;
120+ getByRole ( 'switch ' ) . click ( ) ;
121+ fireEvent . change ( getByRole ( 'switch ' ) , { target : { checked : '' } } ) ;
122122 } ) ;
123123
124- expect ( getByRole ( 'checkbox ' ) ) . to . have . property ( 'checked' , false ) ;
124+ expect ( getByRole ( 'switch ' ) ) . to . have . property ( 'checked' , false ) ;
125125 } ) ;
126126
127127 it ( 'should not show warnings when custom `type` is provided' , ( ) => {
@@ -137,7 +137,7 @@ describe('<Switch />', () => {
137137 </ FormControl > ,
138138 ) ;
139139
140- expect ( getByRole ( 'checkbox ' ) ) . not . to . have . attribute ( 'disabled' ) ;
140+ expect ( getByRole ( 'switch ' ) ) . not . to . have . attribute ( 'disabled' ) ;
141141 } ) ;
142142
143143 it ( 'should be overridden by props' , ( ) => {
@@ -147,7 +147,7 @@ describe('<Switch />', () => {
147147 </ FormControl > ,
148148 ) ;
149149
150- expect ( getByRole ( 'checkbox ' ) ) . to . have . attribute ( 'disabled' ) ;
150+ expect ( getByRole ( 'switch ' ) ) . to . have . attribute ( 'disabled' ) ;
151151 } ) ;
152152 } ) ;
153153
@@ -159,7 +159,7 @@ describe('<Switch />', () => {
159159 </ FormControl > ,
160160 ) ;
161161
162- expect ( getByRole ( 'checkbox ' ) ) . to . have . attribute ( 'disabled' ) ;
162+ expect ( getByRole ( 'switch ' ) ) . to . have . attribute ( 'disabled' ) ;
163163 } ) ;
164164
165165 it ( 'should be overridden by props' , ( ) => {
@@ -169,7 +169,7 @@ describe('<Switch />', () => {
169169 </ FormControl > ,
170170 ) ;
171171
172- expect ( getByRole ( 'checkbox ' ) ) . not . to . have . attribute ( 'disabled' ) ;
172+ expect ( getByRole ( 'switch ' ) ) . not . to . have . attribute ( 'disabled' ) ;
173173 } ) ;
174174 } ) ;
175175 } ) ;
0 commit comments