-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
getUserDisplayName
function to use email
as the first fall…
…back.
- Loading branch information
Showing
4 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,12 +13,22 @@ describe('#getUserDisplayName', () => { | |
expect( | ||
getUserDisplayName({ | ||
full_name: 'my full name', | ||
email: '[email protected]', | ||
username: 'foo', | ||
} as User) | ||
).toEqual('my full name'); | ||
}); | ||
|
||
it(`uses the username when full name is not available`, () => { | ||
it(`uses the email when full name is not available available`, () => { | ||
expect( | ||
getUserDisplayName({ | ||
email: '[email protected]', | ||
username: 'foo', | ||
} as User) | ||
).toEqual('[email protected]'); | ||
}); | ||
|
||
it(`uses the username when full name and email are not available`, () => { | ||
expect( | ||
getUserDisplayName({ | ||
username: 'foo', | ||
|
This file contains 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
This file contains 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