Open
Conversation
srijanreddy98
suggested changes
May 14, 2020
srijanreddy98
left a comment
There was a problem hiding this comment.
Hey @Showtim3, took a pass, I think there are two tests failing, One because of Promise.resolve() in userService.getUserInfoAsync() and another in the tests, if you can change those, it will mostly work
|
|
||
| getUserInfoAsync() { | ||
| if (this.urlService.getPathname() === '/signup') { | ||
| return Promise.resolve(this.userInfoObjectFactory.createDefault()); |
There was a problem hiding this comment.
This shouldn't be Promise.resolve
| return Promise.resolve(this.userInfoObjectFactory.createDefault()); | ||
| } | ||
| if (this.userInfo) { | ||
| return Promise.resolve(this.userInfo); |
There was a problem hiding this comment.
This shouldn't be Promise.resolve
| if (response.user_is_logged_in) { | ||
| this.userInfo = ( | ||
| this.userInfoObjectFactory.createFromBackendDict(response)); | ||
| return Promise.resolve(this.userInfo); |
There was a problem hiding this comment.
This shouldn't be Promise.resolve
| this.userInfoObjectFactory.createFromBackendDict(response)); | ||
| return Promise.resolve(this.userInfo); | ||
| } else { | ||
| return Promise.resolve(this.userInfoObjectFactory.createDefault()); |
There was a problem hiding this comment.
This shouldn't be Promise.resolve
| deferred.resolve('sample-csrf-token'); | ||
| return deferred.promise; | ||
| spyOn(csrfTokenService, 'getTokenAsync').and.callFake(function() { | ||
| return Promise.resolve('sample-csrf-token'); |
There was a problem hiding this comment.
This shouldn't be Promise.resolve
srijanreddy98
suggested changes
May 14, 2020
srijanreddy98
left a comment
There was a problem hiding this comment.
Just resolve is enough, return is not required
| profilePictureDataUrl = response.profile_picture_data_url; | ||
| } | ||
| ); | ||
| return resolve(profilePictureDataUrl); |
| return resolve(profilePictureDataUrl); | ||
| }); | ||
| } else { | ||
| return resolve(profilePictureDataUrl); |
| getUserCommunityRightsData(): Promise<Object> { | ||
| return new Promise((resolve, reject) => { | ||
| if (this.userCommunityRightsInfo) { | ||
| return resolve(this.userCommunityRightsInfo); |
| this.USER_COMMUNITY_RIGHTS_DATA_URL).toPromise().then( | ||
| (response: any) => { | ||
| this.userCommunityRightsInfo = response; | ||
| return resolve(this.userCommunityRightsInfo); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Essential Checklist
PR Pointers