-
-
Notifications
You must be signed in to change notification settings - Fork 118
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
Replay progress events in unit tests #1017
Conversation
…nd for unit testing purposes
Thanks for the quick turnaround on this @gilest! Excited to see this come together 😄 |
@@ -0,0 +1,202 @@ | |||
/* eslint-disable qunit/no-conditional-assertions */ |
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.
Not sure if there's a good way to avoid this 🤔
The data structure and complexity is a bit high for assert.step
and assert.verifySteps
.
I'm pretty confident that replayEvents
is simple enough that assertions are running when we expect them to.
@mkszepp please review ☝🏻 |
@gilest looks good, added two comments in code... |
Assert `uploadFile.size` after replaying events in all specs Improve documentation to highlight the purpose/source of each test
Ah yes – great idea. I have added a test for this.
Thanks – not sure if your code comments got saved, I cannot see any... I'm going to merge and release but feel free to open a tidy-up PR with your suggestions |
Skips the browser, http, network etc. and lets us test the smallest unit of our internals – an
UploadFile
having its state updated by a series ofProgressEvent
events.For each scenario I'm pretty sure we only need to test a single file with a stream of synchronous events.
Covers some recorded events from different browsers and endpoints. We can add more scenarios here if we come across them.
Specifically, the Chrome scenario proves the fix in #1016 – this was previously failing early with 100% progress, which is the same issue reported by users in #1013
I've painstakingly copied values from log screenshots to setup this existing suite. Hopefully contributors can PR full tests in future to make things a bit easier 😅
Fixes #1013