1
-
2
1
import { test , expect } from '@sand4rt/experimental-ct-web' ;
3
2
import { PieRadio } from '../../src/index.ts' ;
4
3
import { type RadioProps } from '../../src/defs.ts' ;
@@ -167,9 +166,11 @@ test.describe('PieRadio - Component tests', () => {
167
166
// Act
168
167
await component . locator ( inputSelector ) . click ( ) ;
169
168
const isValid = await page . evaluate ( ( ) => document . querySelector ( 'pie-radio' ) ?. validity . valid ) ;
169
+ const isValueMissing = await page . evaluate ( ( ) => document . querySelector ( 'pie-radio' ) ?. validity . valueMissing ) ;
170
170
171
171
// Assert
172
172
expect ( isValid ) . toBe ( true ) ;
173
+ expect ( isValueMissing ) . toBe ( false ) ;
173
174
} ) ;
174
175
175
176
test ( 'should be in an invalid state if the radio is required but unchecked' , async ( { mount, page } ) => {
@@ -184,9 +185,11 @@ test.describe('PieRadio - Component tests', () => {
184
185
185
186
// Act
186
187
const isValid = await page . evaluate ( ( ) => document . querySelector ( 'pie-radio' ) ?. validity . valid ) ;
188
+ const isValueMissing = await page . evaluate ( ( ) => document . querySelector ( 'pie-radio' ) ?. validity . valueMissing ) ;
187
189
188
190
// Assert
189
191
expect ( isValid ) . toBe ( false ) ;
192
+ expect ( isValueMissing ) . toBe ( true ) ;
190
193
} ) ;
191
194
192
195
test ( 'should be in a valid state if the radio is checked but not required' , async ( { mount, page } ) => {
@@ -201,9 +204,11 @@ test.describe('PieRadio - Component tests', () => {
201
204
202
205
// Act
203
206
const isValid = await page . evaluate ( ( ) => document . querySelector ( 'pie-radio' ) ?. validity . valid ) ;
207
+ const isValueMissing = await page . evaluate ( ( ) => document . querySelector ( 'pie-radio' ) ?. validity . valueMissing ) ;
204
208
205
209
// Assert
206
210
expect ( isValid ) . toBe ( true ) ;
211
+ expect ( isValueMissing ) . toBe ( false ) ;
207
212
} ) ;
208
213
209
214
test ( 'should be in a valid state if the radio is unchecked and not required' , async ( { mount, page } ) => {
@@ -218,9 +223,11 @@ test.describe('PieRadio - Component tests', () => {
218
223
219
224
// Act
220
225
const isValid = await page . evaluate ( ( ) => document . querySelector ( 'pie-radio' ) ?. validity . valid ) ;
226
+ const isValueMissing = await page . evaluate ( ( ) => document . querySelector ( 'pie-radio' ) ?. validity . valueMissing ) ;
221
227
222
228
// Assert
223
229
expect ( isValid ) . toBe ( true ) ;
230
+ expect ( isValueMissing ) . toBe ( false ) ;
224
231
} ) ;
225
232
} ) ;
226
233
} ) ;
0 commit comments