-
Notifications
You must be signed in to change notification settings - Fork 398
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
changes editUserAccount to updateUserAccount #5274
Conversation
Codecov Report
@@ Coverage Diff @@
## master mozilla/addons-frontend#5274 +/- ##
=======================================
Coverage 97.02% 97.02%
=======================================
Files 217 217
Lines 5521 5521
Branches 1078 1078
=======================================
Hits 5357 5357
Misses 145 145
Partials 19 19
Continue to review full report at Codecov.
|
@willdurand is there something more to be done? |
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 taking this on, @gabru-md. There are a few more places where "editUserAccount" is referenced, for example there's finishEditUserAccount
, FinishEditUserAccountParams
, FinishEditUserAccountAction
, EditUserAccountParams
, EditUserAccountAction
, and FINISH_EDIT_USER_ACCOUNT
.
All of these should also be renamed.
okay @bobsilverberg . I'll make the changes 👍 |
@bobsilverberg I've done the changes. |
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 looks good, nice work @gabru-md. We're almost there. In addition to my comments below, I noticed that there's still a helper function in TestUserProfileEdit.js called _editUserAccount
. That should be renamed to _updateUserAccount
.
tests/unit/amo/sagas/test_users.js
Outdated
describe('editUserAccount', () => { | ||
it('calls the API to edit a user after editUserAccount()', async () => { | ||
describe('updateUserAccount', () => { | ||
it('calls the API to edit a user after updateUserAccount()', 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 should probably change to calls the API to update a user...
.
src/amo/sagas/users.js
Outdated
@@ -76,7 +76,7 @@ export function* editUserAccount({ | |||
log.warn(`Could not edit user account: ${error}`); |
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 should be changed to Could not update user account...
.
@@ -50,7 +50,7 @@ describe(__filename, () => { | |||
}); | |||
}); | |||
|
|||
describe('editUserAccount', () => { | |||
describe('updateUserAccount', () => { | |||
const getParams = (params = {}) => { | |||
const state = dispatchSignInActions().store.getState(); | |||
const userId = getCurrentUser(state.users).id; |
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.
There's a line below (line 61), which should be changed from it('edits a userProfile and...
to it('updates a userProfile and...
.
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 description still needs to be updated in tests/unit/amo/api/test_users.js
.
tests/unit/amo/sagas/test_users.js
Outdated
@@ -244,7 +244,7 @@ describe(__filename, () => { | |||
.once() | |||
.returns(Promise.resolve(allNotifications)); | |||
|
|||
sagaTester.dispatch(editUserAccount({ | |||
sagaTester.dispatch(updateUserAccount({ | |||
errorHandlerId: errorHandler.id, | |||
notifications, | |||
picture: null, |
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.
There's a line below (line 266), on which the description should be changed from it('cancels the edit and dispatches...
to it('cancels the update and dispatches ...
.
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 looks great, thanks @gabru-md. There's just one comment from the last time I reviewed this, about a description in a test, which still needs to be addressed. Once that's fixed this should be good to land.
@@ -50,7 +50,7 @@ describe(__filename, () => { | |||
}); | |||
}); | |||
|
|||
describe('editUserAccount', () => { | |||
describe('updateUserAccount', () => { | |||
const getParams = (params = {}) => { | |||
const state = dispatchSignInActions().store.getState(); | |||
const userId = getCurrentUser(state.users).id; |
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 description still needs to be updated in tests/unit/amo/api/test_users.js
.
@bobsilverberg is there anything left? |
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 looks great, thanks for all your work on this @gabru-md, and sorry for my delay in getting back to you.
The only issue now is that this has conflicts with our current master branch, and those need to be resolved by rebasing it on top of master. If you are comfortable doing that, please do so and ping me when it's done. Otherwise I'd be happy to do it for you and land the code.
@bobsilverberg I'm done with the rebase as well as the Travis Fixes. |
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 so much @gabru-md. Nice work! 👍
Thanks You @bobsilverberg |
Fixes mozilla/addons#11857
changes
editUserAccount
toupdateUserAccount
in all files and tests.changes all functions and tests that match with
editUser
toupdateUser
PRs open for the same issue.
Fixes #ISSUENUM
at the top of your PR.Cheers!