-
Notifications
You must be signed in to change notification settings - Fork 438
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
js: isso.js: Disable Postbox submit button on click, enable after response #993
js: isso.js: Disable Postbox submit button on click, enable after response #993
Conversation
716c072
to
d3a1b82
Compare
c774e0a
to
e4178a1
Compare
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.
A few small issues to correct (see inline review), otherwise a nice PR. Thank you @pkvach!
@@ -264,3 +269,32 @@ test("should execute GET/PUT/POST/DELETE requests correctly", async () => { | |||
{ text: 'New comment body' }, | |||
); | |||
}); | |||
|
|||
test("Postbox submit button should be disabled on submit click and enabled after response", async () => { |
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 test case doesn't actually test whether the button is re-enabled after the response, only on an aborted request. Should be trivial to add.
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.
Thanks for pointing that out.
I've actually already added a check to ensure the button isn't disabled after a response in the existing test:
"should fill Postbox with valid data and receive 201 reply."
You can see the change here: https://github.com/isso-comments/isso/pull/993/files#diff-f636e0fc5201601aa0484b5e325aa506fae5d9b6fcba34d635497f94939ed059R151.
Since that covers this scenario, a separate test might be redundant.
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.
I agree, you're covering all the bases already. Just please adjust the test titles (this one and the one above outside the diff) so that they reflect what's actually happening.
Also, you have 3 identically named commits with the same commit body. You probably meant to amend a single commit or split the tests but forgot to write commit messages. |
b0d3d0e
to
e532af7
Compare
Is there something missing that prevents you from removing the draft status? |
I've noticed that E2E tests are failing due to timeout on checks, and it's happening in different places. I thought it was due to changes in PR and was looking for a solution. |
Sorry about that, I'm still trying to understand why the integration tests are so flaky. Maybe it has something to do with using |
69c1cbf
to
5c9a0c9
Compare
…ponse Disable the submit button in Postbox to prevent double posting upon click. Enable the button after receiving a response from the API endpoint. Fixes isso-comments#913
5c9a0c9
to
27f55e1
Compare
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.
LGTM!
I hope the usability of the screenshot tests wasn't too bad for you. I found them useful at the time when I created them because we were messing up some of the CSS/layout with a lot of attempted cleanups. At least the tests don't seem to be flaky any more ;) |
It took me a little while to get the hang of them, but I found them very helpful. |
Checklist
What changes does this Pull Request introduce?
Disable the submit button in Postbox to prevent double posting upon click. Enable the button after receiving a response from the API endpoint.
Why is this necessary?
Fixes #913