@@ -136,7 +136,9 @@ describe('Update SV Reward Weight Form', () => {
136136 await user . clear ( expiryDateInput ) ;
137137 await user . type ( expiryDateInput , thePast ) ;
138138
139- expect ( screen . getByText ( 'Expiration must be in the future' ) ) . toBeDefined ( ) ;
139+ waitFor ( ( ) => {
140+ expect ( screen . queryByText ( 'Expiration must be in the future' ) ) . toBeDefined ( ) ;
141+ } ) ;
140142
141143 await user . clear ( expiryDateInput ) ;
142144 await user . type ( expiryDateInput , theFuture ) ;
@@ -166,7 +168,7 @@ describe('Update SV Reward Weight Form', () => {
166168 await user . type ( effectiveDateInput , effectiveDate . format ( dateTimeFormatISO ) ) ;
167169
168170 waitFor ( ( ) => {
169- expect ( screen . getByText ( 'Effective Date must be after expiration date' ) ) . toBeDefined ( ) ;
171+ expect ( screen . queryByText ( 'Effective Date must be after expiration date' ) ) . toBeDefined ( ) ;
170172 } ) ;
171173
172174 const validEffectiveDate = expiryDate . add ( 1 , 'day' ) . format ( dateTimeFormatISO ) ;
@@ -209,7 +211,9 @@ describe('Update SV Reward Weight Form', () => {
209211 expect ( weightInput ) . toBeDefined ( ) ;
210212 await user . type ( weightInput , '123abc' ) ;
211213
212- expect ( screen . getByText ( 'Weight must be a valid number' ) ) . toBeDefined ( ) ;
214+ waitFor ( ( ) => {
215+ expect ( screen . getByText ( 'Weight must be a valid number' ) ) . toBeDefined ( ) ;
216+ } ) ;
213217
214218 await user . clear ( weightInput ) ;
215219 await user . type ( weightInput , '1001' ) ;
0 commit comments