@@ -114,17 +114,17 @@ describe(Agent, () => {
114114 index ?? 0
115115 ] ;
116116
117- await userEvent . type ( textbox , modifiedValue ) ;
117+ await userEvent . type ( textbox , modifiedValue , { delay : null } ) ;
118118 }
119119
120- await waitFor ( ( ) => screen . getByText ( / S a v i n g | S a v e d / i ) , {
121- timeout : 2000 ,
122- } ) ;
123-
124- expect ( putSpy ) . toHaveBeenCalledWith (
125- expect . objectContaining ( {
126- [ field ] : expect . stringContaining ( modifiedValue ) ,
127- } )
120+ await waitFor (
121+ ( ) =>
122+ expect ( putSpy ) . toHaveBeenCalledWith (
123+ expect . objectContaining ( {
124+ [ field ] : expect . stringContaining ( modifiedValue ) ,
125+ } )
126+ ) ,
127+ { timeout : 1000 }
128128 ) ;
129129 } ) ;
130130
@@ -154,7 +154,7 @@ describe(Agent, () => {
154154 const iconSrc = iconSelections [ 0 ] . getAttribute ( "src" ) ;
155155 await userEvent . click ( iconSelections [ 0 ] ) ;
156156
157- await waitFor ( ( ) => screen . getByText ( / S a v i n g | S a v e d / i ) ) ;
157+ await waitFor ( ( ) => expect ( putSpy ) . toHaveBeenCalled ( ) , { timeout : 20 } ) ;
158158
159159 expect ( putSpy ) . toHaveBeenCalledWith (
160160 expect . objectContaining ( {
@@ -203,7 +203,7 @@ describe(Agent, () => {
203203 ) . getAllByRole ( "button" ) [ 1 ] ;
204204 await userEvent . click ( imageDeleteButton ) ;
205205
206- await waitFor ( ( ) => screen . getByText ( / S a v i n g | S a v e d / i ) ) ;
206+ await waitFor ( ( ) => expect ( putSpy ) . toHaveBeenCalled ( ) , { timeout : 20 } ) ;
207207
208208 expect ( putSpy ) . toHaveBeenCalledWith (
209209 expect . objectContaining ( {
0 commit comments