Closed (fixed)
Project:
Antibot
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2020 at 19:26 UTC
Updated:
23 Nov 2021 at 05:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #3
darvanenThe test was using jQuery, let's see what the testbot makes of this.
Comment #5
darvanenAh. Pure JS .submit() doesn't return true.
Comment #6
jwilson3This change is not 1-to-1 I wouldn't depend on id attribute for anything these days, and most of core now depends on data-drupal-selector.
Maybe try with
document.querySelectorAll('form[data-drupal-selector="user-pass"]');?Comment #7
darvanenFair enough, regardless the test won't work using a plain JS .submit() because it won't return true in assertJsCondition().
The only way I can see to get that test working is to enable jQuery for the tests but I feel like that's the wrong thing to do. I'm not very experienced with the test suite.
Comment #9
paulocsA made a little change in the tests to remove the JQuery dependency.
Here is the interdiff between patch #3 and the merge request.
Comment #11
paulocsComment #12
gabrieldaReviewing this one
Comment #13
gabrieldaUnassigning from myself
Comment #14
gabrieldaComment #15
gabrieldaChecked all tests, could not find any jQuery dependency related to it. Hence moving to RTBC.
Comment #16
gaurav.kapoor commentedWas going through the code changes by checking out to the branch from which MR has been made and I noticed there is a deprecation warning being shown for the 'keyCode'. Maybe we should figure out the alternative for that first and then move forward with this.
Comment #17
darvanenThanks for finding that deprecation!
Standard procedure is to handle all deprecations and code standard changes not directly introduced by an issue in a separate issue.
Please open another issue if you haven't already to deal with the deprecation, it should not be dealt with in this issue, and there is no reason to postpone this work because of it.
Comment #18
darvanenAnd, thank you @gabrielda for the review! Welcome to the Drupal community :)
Comment #19
darvanen@guarav.kapoor apologies, I see you're a maintainer in which case maintainer's privilege overrides :)
I'll open a new ticket to handle that piece.
Comment #20
darvanenAhhhhahahahah hello hubris my old friend... I really should have looked deeper before commenting. My apologies a second time.
In core this would probably still be split out into two separate issues but it's such a small change I see no reason not to add it here. Pushed that change to the MR.
Comment #21
gaurav.kapoor commented@darvanen Relax!! and thank you for letting me know deprecations are handled in separate issues, I have seen issues specific to handle deprecations but I wasn't really sure about that. Thank you so much for working on this, this looks good to me, I'll be reviewing and pushing it today.
Comment #22
darvanenAll good!
Life's too short not to be able to laugh at myself ;)
Comment #23
gaurav.kapoor commentedThere should be a feature of displaying a 'maintainer badge' in the issue queue comments.
Comment #24
gaurav.kapoor commentedI noticed that, this change wasn't working:
as e.code returns string values such as 'Enter' or 'Tab' and not the code.
I have done this change:
So, that antibot script can detect if the user has pressed enter or tab key. Also, changed the event from 'keypress' to 'keydown' as 'keypress' wasn't working with the tab key.
Let me know if this isn't the right solution.
Comment #25
darvanenAhhh yep, looks like keypress is deprecated too /facepalm. The change looks good to me in the comment.
I guess we should try and put in some test coverage around that funcationality. I couldn't get the FunctionalJavascript tests running on my local machine though.
Comment #26
gaurav.kapoor commentedTurns out there is already @todo by previous maintainers to add test coverage for this scenario. Will open up a new issue for that.
Comment #27
gaurav.kapoor commentedTested this in my local, the module is working perfectly fine, didn't see any break in the functionality or any JS errors.
Comment #28
gaurav.kapoor commentedThanks, everyone for working on this