Skip to content

Commit 6ef8257

Browse files
committed
Update tests
1 parent 076f3a1 commit 6ef8257

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Tests/FormHookTests/FormHookTests.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -906,11 +906,10 @@ struct FormControlTriggerTests {
906906
var formState = formControl.instantFormState
907907
#expect(!formState.errors.errorFields.contains(.a))
908908

909-
// Wait for delay to pass
910-
try? await Task.sleep(nanoseconds: 120_000_000) // 120ms
911-
912-
// Force sync the form state to ensure changes are reflected
913-
await formControl.syncFormState()
909+
// Wait for the delayed error task to complete
910+
if let errorTask = formControl.currentErrorNotifyTask {
911+
try? await errorTask.value
912+
}
914913

915914
formState = formControl.instantFormState
916915
#expect(formState.errors.errorFields.contains(.a))

0 commit comments

Comments
 (0)