Skip to content
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

Merged
merged 1 commit into from
Jun 26, 2018

Conversation

gabru-md
Copy link
Contributor

@gabru-md gabru-md commented Jun 12, 2018

Fixes mozilla/addons#11857

changes editUserAccount to updateUserAccount in all files and tests.
changes all functions and tests that match with editUser to updateUser

  • This PR relates to an existing open issue and there are no existing
    PRs open for the same issue.
  • Add Fixes #ISSUENUM at the top of your PR.
  • Add a description of the the changes introduced in this PR.

Cheers!

@codecov-io
Copy link

codecov-io commented Jun 12, 2018

Codecov Report

Merging #5274 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           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
Impacted Files Coverage Δ
src/amo/api/users.js 100% <ø> (ø) ⬆️
src/amo/components/UserProfileEdit/index.js 100% <ø> (ø) ⬆️
src/amo/reducers/users.js 100% <100%> (ø) ⬆️
src/amo/sagas/users.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ca49275...509157b. Read the comment docs.

@gabru-md
Copy link
Contributor Author

@willdurand is there something more to be done?

Copy link
Contributor

@bobsilverberg bobsilverberg left a 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.

@bobsilverberg bobsilverberg self-assigned this Jun 14, 2018
@gabru-md
Copy link
Contributor Author

okay @bobsilverberg . I'll make the changes 👍

@gabru-md
Copy link
Contributor Author

@bobsilverberg I've done the changes.
Travis is passing as well. 😃

Copy link
Contributor

@bobsilverberg bobsilverberg left a 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.

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 () => {
Copy link
Contributor

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....

@@ -76,7 +76,7 @@ export function* editUserAccount({
log.warn(`Could not edit user account: ${error}`);
Copy link
Contributor

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;
Copy link
Contributor

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....

Copy link
Contributor

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 .

@@ -244,7 +244,7 @@ describe(__filename, () => {
.once()
.returns(Promise.resolve(allNotifications));

sagaTester.dispatch(editUserAccount({
sagaTester.dispatch(updateUserAccount({
errorHandlerId: errorHandler.id,
notifications,
picture: null,
Copy link
Contributor

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 ....

Copy link
Contributor

@bobsilverberg bobsilverberg left a 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;
Copy link
Contributor

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 .

@gabru-md
Copy link
Contributor Author

@bobsilverberg is there anything left?

Copy link
Contributor

@bobsilverberg bobsilverberg left a 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.

@gabru-md
Copy link
Contributor Author

@bobsilverberg I'm done with the rebase as well as the Travis Fixes.
I've also squashed all of my commits. Perhaps you can take a look 😄

Copy link
Contributor

@bobsilverberg bobsilverberg left a 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! 👍

@bobsilverberg bobsilverberg merged commit d1b2f7e into mozilla:master Jun 26, 2018
@gabru-md gabru-md deleted the gabru-md/patch branch June 27, 2018 12:28
@gabru-md
Copy link
Contributor Author

Thanks You @bobsilverberg
I would love to take up more issues and help the community 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename editUserAccount to updateUserAccount
3 participants