-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
FIX: signup form validation on page reload #7768
Conversation
Codecov Report
@@ Coverage Diff @@
## main #7768 +/- ##
==========================================
+ Coverage 81.96% 82.21% +0.24%
==========================================
Files 97 100 +3
Lines 5629 5773 +144
==========================================
+ Hits 4614 4746 +132
- Misses 1015 1027 +12
|
Please have a look at it when you have a moment. I messed up the last PR because of issues with my laptop and had to use someone else's. |
@jywarren @cesswairimu @emilyashley @VladimirMikulic please review it and convey the requested changes. I'm aware that I haven't used the best practice to check if email input is valid but I still have queries regarding how to access the returned result of queries. I'll fix this as soon as I get them cleared. Meanwhile, since this was an issue of high priority I've opened a PR with a possible solution. |
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.
Hi @Shreyaa-s , can you pls remove the spaces added by mistake on several lines in this PR ?
Would just help maintain coding standards across the community !
@ananyaarun done! Thanks for mentioning it. |
Can we write a system test to ensure this? |
@SidharthBansal I don't have any prior experience with writing system tests. I would love to give it a try though. Could you brief me about it a little? Thanks! |
Hi, there are some good examples here; basically you can interact with the page using various commands, and it "autopilots" the browser to run through tests interactively: https://github.com/publiclab/plots2/blob/master/test/system/sessions_test.rb There is more documentation here! https://github.com/publiclab/plots2/blob/master/SYSTEM_TESTS.md |
Thank you so much! |
I'm learning to write system tests on Ruby. I'm thinking along the lines of writing a system test that would first stimulate a user that is already registered, like 'Jeff', check if error is thrown and if so, it would then stimulate a newcomer and check for successful registration. Is this the right way? Correct me if I am wrong. And what are your expectations with the signup test? |
26285ef
to
689738a
Compare
@jywarren I've written the system test and tested it locally but the build is failing, can you help me figure out why? Thanks! |
* fixes signup form validation on page reload * adds system test
689738a
to
f974587
Compare
@jywarren I found the error and fixed it. Please review. Thanks! |
Hi @Shreyaa-s this is a really well written PR. Great work. Before merging it, I want to see if we need to think through some of the issues I've written up here: #7816 Thanks, then we can make a call on merging this! |
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, @jywarren can we merge this now?
To address the issues discussed in #7816 , I've only changed how the individual validation functions are called rather than the function itself. Earlier the functions were called only when the respective input field witnessed a change. As for the above mentioned, |
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.
Looks great. 🎉 🎉 .thanks everyone 💯
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 as well 🎉
restarting travis |
Ack, so sorry I missed this! All good here, many many thanks to everyone! 👍 🎉 🎉 🎉 🎉 |
Would someone be able to test this out on https://stable.publiclab.org quickly once it's done building? Just to be sure as it's a critical system. Thanks!!! |
I just tested on stable, its working great. Thanks everyone 🎉 |
* fixes signup form validation on page reload * adds system test
* fixes signup form validation on page reload * adds system test
* fixes signup form validation on page reload * adds system test
* fixes signup form validation on page reload * adds system test
* fixes signup form validation on page reload * adds system test
* fixes signup form validation on page reload * adds system test
* fixes signup form validation on page reload * adds system test
* fixes signup form validation on page reload * adds system test
Fixes #7618
rake test
@publiclab/reviewers
for help, in a comment belowThis PR fixes the sign up form validation. Earlier if the form encountered an error like email already registered, then even after changing the email the sign up button would remain disabled unless all input fields were changed. This PR fixes the issue.
Thanks!