-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c211680
commit c9b41ad
Showing
2 changed files
with
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ describe('Sidebar', () => { | |
// Wrap Onyx each onyx action with waitForBatchedUpdates | ||
wrapOnyxWithWaitForBatchedUpdates(Onyx); | ||
// Initialize the network key for OfflineWithFeedback | ||
return TestHelper.signInWithTestUser(1, '[email protected]', undefined, undefined, 'One', '').then(() => Onyx.merge(ONYXKEYS.NETWORK, {isOffline: false})); | ||
return TestHelper.signInWithTestUser(1, '[email protected]', undefined, undefined, 'One').then(() => Onyx.merge(ONYXKEYS.NETWORK, {isOffline: false})); | ||
}); | ||
|
||
// Clear out Onyx after each test so that each test starts with a clean slate | ||
|
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 |
---|---|---|
|
@@ -47,15 +47,15 @@ function setupApp() { | |
}); | ||
} | ||
|
||
function buildPersonalDetails(login: string, accountID: number, firstName = 'Test', lastName = 'User'): PersonalDetails { | ||
function buildPersonalDetails(login: string, accountID: number, firstName = 'Test'): PersonalDetails { | ||
return { | ||
accountID, | ||
login, | ||
avatar: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_7.png', | ||
avatarThumbnail: 'https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/avatar_7.png', | ||
displayName: `${firstName}${lastName ? '' : ` ${lastName}`}`, | ||
displayName: `${firstName} User`, | ||
firstName, | ||
lastName, | ||
lastName: 'User', | ||
pronouns: '', | ||
timezone: CONST.DEFAULT_TIME_ZONE, | ||
phoneNumber: '', | ||
|
@@ -66,7 +66,7 @@ function buildPersonalDetails(login: string, accountID: number, firstName = 'Tes | |
* Simulate signing in and make sure all API calls in this flow succeed. Every time we add | ||
* a mockImplementationOnce() we are altering what Network.post() will return. | ||
*/ | ||
function signInWithTestUser(accountID = 1, login = '[email protected]', password = 'Password1', authToken = 'asdfqwerty', firstName = 'Test', lastName = 'User') { | ||
function signInWithTestUser(accountID = 1, login = '[email protected]', password = 'Password1', authToken = 'asdfqwerty', firstName = 'Test') { | ||
const originalXhr = HttpUtils.xhr; | ||
|
||
HttpUtils.xhr = jest.fn().mockImplementation(() => { | ||
|
@@ -90,7 +90,7 @@ function signInWithTestUser(accountID = 1, login = '[email protected]', password = ' | |
onyxMethod: Onyx.METHOD.MERGE, | ||
key: ONYXKEYS.PERSONAL_DETAILS_LIST, | ||
value: { | ||
[accountID]: buildPersonalDetails(login, accountID, firstName, lastName), | ||
[accountID]: buildPersonalDetails(login, accountID, firstName), | ||
}, | ||
}, | ||
], | ||
|