@@ -102,19 +102,19 @@ describe(Agent, () => {
102
102
const modifiedValue = faker . word . words ( { count : { min : 2 , max : 5 } } ) ;
103
103
104
104
if ( ! as ) {
105
- await userEvent . type ( screen . getByDisplayValue ( searchFor ) , modifiedValue ) ;
105
+ await userEvent . click ( screen . getByDisplayValue ( searchFor ) ) ;
106
+ await userEvent . paste ( modifiedValue ) ;
106
107
} else if ( as === "placeholder" ) {
107
- await userEvent . type (
108
- screen . getByPlaceholderText ( searchFor ) ,
109
- modifiedValue
110
- ) ;
108
+ await userEvent . click ( screen . getByPlaceholderText ( searchFor ) ) ;
109
+ await userEvent . paste ( modifiedValue ) ;
111
110
} else if ( as === "textbox" ) {
112
111
const heading = screen . getByRole ( "heading" , { name : searchFor } ) ;
113
112
const textbox = within ( heading . parentElement ! ) . queryAllByRole ( "textbox" ) [
114
113
index ?? 0
115
114
] ;
116
115
117
- await userEvent . type ( textbox , modifiedValue , { delay : null } ) ;
116
+ await userEvent . click ( textbox ) ;
117
+ await userEvent . paste ( modifiedValue ) ;
118
118
}
119
119
120
120
await waitFor (
@@ -126,6 +126,7 @@ describe(Agent, () => {
126
126
) ,
127
127
{ timeout : 1000 }
128
128
) ;
129
+ expect ( putSpy ) . toHaveBeenCalledTimes ( 1 ) ;
129
130
} ) ;
130
131
131
132
it ( "Updating icon triggers save" , async ( ) => {
@@ -154,7 +155,7 @@ describe(Agent, () => {
154
155
const iconSrc = iconSelections [ 0 ] . getAttribute ( "src" ) ;
155
156
await userEvent . click ( iconSelections [ 0 ] ) ;
156
157
157
- await waitFor ( ( ) => expect ( putSpy ) . toHaveBeenCalled ( ) , { timeout : 20 } ) ;
158
+ await waitFor ( ( ) => expect ( putSpy ) . toHaveBeenCalled ( ) ) ;
158
159
159
160
expect ( putSpy ) . toHaveBeenCalledWith (
160
161
expect . objectContaining ( {
@@ -203,7 +204,7 @@ describe(Agent, () => {
203
204
) . getAllByRole ( "button" ) [ 1 ] ;
204
205
await userEvent . click ( imageDeleteButton ) ;
205
206
206
- await waitFor ( ( ) => expect ( putSpy ) . toHaveBeenCalled ( ) , { timeout : 20 } ) ;
207
+ await waitFor ( ( ) => expect ( putSpy ) . toHaveBeenCalled ( ) ) ;
207
208
208
209
expect ( putSpy ) . toHaveBeenCalledWith (
209
210
expect . objectContaining ( {
0 commit comments