-
Notifications
You must be signed in to change notification settings - Fork 975
Autofill should focus on first entry Fix #8280 #8510
Conversation
@@ -136,7 +138,7 @@ class AutofillAddressPanel extends ImmutableComponent { | |||
)} | |||
data-test-id='nameOnAddress' | |||
spellCheck='false' onKeyDown={this.onKeyDown} onChange={this.onNameChange} | |||
value={this.props.currentDetail.get('name')} | |||
value={this.props.currentDetail.get('name') || ''} |
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 added default value as {this.props.currentDetail.get('name') || ''}
to avoid the warning (because of react 15 upgrade).
warning.js?8a56:36
Warning: AutofillAddressPanel is changing an uncontrolled input of type undefined to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://fb.me/react-controlled-components.
@@ -115,7 +118,7 @@ class AutofillCreditCardPanel extends ImmutableComponent { | |||
spellCheck='false' | |||
onKeyDown={this.onKeyDown} | |||
onChange={this.onNameChange} | |||
value={this.props.currentDetail.get('name')} | |||
value={this.props.currentDetail.get('name') || ''} |
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.
same here.
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.
@kumarrishav could you also add test to test/contents/autofillTest.js
?
@darkdh will test/contents/autofillTest.js be right place to test this? As name suggests this is to test the content in input field. I tried to find autofill related test test/app/renderer/components/ but couldn't find any. |
@kumarrishav you can add test there for now. All the autofill tests are in |
@darkdh sure will do. |
sorry for the inconvenience. please do the following steps
|
@darkdh sorry it failed again.
/Users/krishav/Documents/FOSS/Brave/browser-laptop/node_modules/bindings/bindings.js:83 Error: The module '/Users/krishav/Documents/FOSS/Brave/browser-laptop/node_modules/leveldown/build/Release/leveldown.node' |
why this version issue is happening? |
@kumarrishav it is because we have different ABI version. Please contain this commit 576921b and try again. |
@darkdh this fixes the issue. |
@darkdh I am not sure how to test the 'focus' thing in integration test. Also, i am getting this error while running test. I think unit test is right place to test it. |
@kumarrishav please rebase to master and try again. There will be some intermittent errors but at least |
@darkdh sorry, but still same error. It fails at beforeEach hook. Though it fills the form, but fails at first it.('adds an autofill address' function * () {}) itself |
@kumarrishav I just try running test on the master and it's working for me |
@kumarrishav to run webdriver test open a console, run |
@kumarrishav you can also run |
Sorry @darkdh Still same error. Don't know why it's not working in my system (Mac OS, Node -v : 7.9.0 and npm 4.2.0). Can we move this test later to UT (and file another issue for same) |
ecf383c
to
d1f502a
Compare
@kumarrishav , I've added the test in d1f502a |
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.
Changes look great! Tested manually and also ran npm run test -- --grep="Autofill"
; everything is looking good 😄
Thanks, @kumarrishav! 😄 |
Test Plan:
Description
Fix #8280
git rebase -i
to squash commits (if needed).