File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -30,12 +30,11 @@ const Banana = () => (
30
30
31
31
test ( 'getByDisplayValue, queryByDisplayValue' , ( ) => {
32
32
render ( < Banana /> ) ;
33
- const input = screen . getByDisplayValue ( / c u s t o m / i) ;
34
33
34
+ const input = screen . getByDisplayValue ( / c u s t o m / i) ;
35
35
expect ( input ) . toHaveDisplayValue ( INPUT_FRESHNESS ) ;
36
36
37
37
const sameInput = screen . getByDisplayValue ( INPUT_FRESHNESS ) ;
38
-
39
38
expect ( sameInput ) . toHaveDisplayValue ( INPUT_FRESHNESS ) ;
40
39
expect ( ( ) => screen . getByDisplayValue ( 'no value' ) ) . toThrow (
41
40
'Unable to find an element with displayValue: no value' ,
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export async function type(
47
47
48
48
let currentText = getTextInputValue ( element ) ;
49
49
for ( const key of keys ) {
50
- const previousText = element . props . value ?? currentText ;
50
+ const previousText = getTextInputValue ( element ) ;
51
51
const proposedText = applyKey ( previousText , key ) ;
52
52
const isAccepted = isTextChangeAccepted ( element , proposedText ) ;
53
53
currentText = isAccepted ? proposedText : previousText ;
@@ -60,7 +60,7 @@ export async function type(
60
60
} ) ;
61
61
}
62
62
63
- const finalText = element . props . value ?? currentText ;
63
+ const finalText = getTextInputValue ( element ) ;
64
64
await wait ( this . config ) ;
65
65
66
66
if ( options ?. submitEditing ) {
You can’t perform that action at this time.
0 commit comments