-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[open-formulieren/open-forms#3611] Make time bounds validation inclusive #596
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #596 +/- ##
==========================================
+ Coverage 72.00% 72.79% +0.78%
==========================================
Files 213 213
Lines 4319 4323 +4
Branches 1152 1155 +3
==========================================
+ Hits 3110 3147 +37
+ Misses 1162 1134 -28
+ Partials 47 42 -5 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need to be rebased on main to fix failing tests?
b4f1e4e
to
d245e80
Compare
Weird, tests pass locally (before and after rebase). And the failing tests are from the hash based routing PR |
I suspect a race condition in the redirect flow vs. test assertion time, I had similar suspicious flaky local failures too in another branch. |
By "time" do you mean the tests related to the time validation? or in the literal sense |
The point in physical time when the test assertion line executes - I suspect that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's aim to fix the test race conditions/flakiness separately, however this test refactor needs to either call the done
callback or use await sleep(300)
for the delays and then make the assertions.
setTimeout(() => { | ||
if (valid) { | ||
expect(!!component.error).toBeFalsy(); | ||
} else { | ||
expect(!!component.error).toBeTruthy(); | ||
expect(component.error.message).toEqual('invalid_time'); | ||
} | ||
}, 300); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should also be made async, I think we have a sleep
utility somewhere. Now the end of test execution is never signalled and the block likely exits before the assertions are made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh, feels really weird from a UX perspective. I guess this is the current state of JS frontend tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it has everything to do with Formio's event dispatching and debouncing. With a pure react implementation, we shouldn't need setTimeout
anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test flakiness was addressed in #599
…usive Backport-of: #596
Backported in 41138f2 |
Fixes open-formulieren/open-forms#3611