Skip to content

Commit 6b4b44e

Browse files
authored
Fix flakey UI test (#1780)
--------- Signed-off-by: fayi-da <fayimora.femibalogun@digitalasset.com>
1 parent eab5873 commit 6b4b44e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

apps/sv/frontend/src/__tests__/governance/forms/update-sv-reward-weight-form-test.test.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)