-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
de50342
commit e6cdbd9
Showing
2 changed files
with
13 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import Str from 'expensify-common/lib/str'; | ||
import type {OnyxUpdate} from 'react-native-onyx'; | ||
import Onyx from 'react-native-onyx'; | ||
import CONST from '@src/CONST'; | ||
import * as Session from '@src/libs/actions/Session'; | ||
|
@@ -18,7 +19,13 @@ type MockFetch = ReturnType<typeof jest.fn> & { | |
resume?: () => Promise<void>; | ||
}; | ||
|
||
type Response = {ok: boolean; json: () => Promise<{jsonCode: number}>}; | ||
type Response = { | ||
ok?: boolean; | ||
json?: () => Promise<{jsonCode: number}>; | ||
jsonCode?: number; | ||
onyxData?: OnyxUpdate[]; | ||
}; | ||
|
||
type QueueItem = (value: Response | PromiseLike<Response>) => void; | ||
|
||
type FormData = { | ||
|
@@ -51,7 +58,7 @@ function signInWithTestUser(accountID = 1, login = '[email protected]', password = ' | |
|
||
HttpUtils.xhr = jest.fn().mockImplementation(() => { | ||
// Your mocked response object | ||
const mockedResponse = { | ||
const mockedResponse: Response = { | ||
onyxData: [ | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
|