forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 20354-task_share_destination_selector_refactor
- Loading branch information
Showing
545 changed files
with
11,057 additions
and
9,099 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
**/node_modules/* | ||
**/dist/* | ||
android/**/build/* | ||
.github/actions/**/index.js" | ||
docs/vendor/** |
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
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
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
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
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,3 +1,4 @@ | ||
// eslint-disable-next-line import/no-import-module-exports | ||
import mockRNLocalize from 'react-native-localize/mock'; | ||
|
||
module.exports = mockRNLocalize; |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/** | ||
* We are disabling the lint rule that doesn't allow the usage of Onyx.connect outside libs | ||
* because the intent of this file is to mock the usage of react-native-onyx so we will have to mock the connect function | ||
*/ | ||
|
||
/* eslint-disable rulesdir/prefer-onyx-connect-in-libs */ | ||
import type {ConnectOptions, OnyxKey} from 'react-native-onyx'; | ||
import Onyx, {withOnyx} from 'react-native-onyx'; | ||
|
||
let connectCallbackDelay = 0; | ||
function addDelayToConnectCallback(delay: number) { | ||
connectCallbackDelay = delay; | ||
} | ||
|
||
type ReactNativeOnyxMock = { | ||
addDelayToConnectCallback: (delay: number) => void; | ||
} & typeof Onyx; | ||
|
||
type ConnectionCallback<TKey extends OnyxKey> = NonNullable<ConnectOptions<TKey>['callback']>; | ||
type ConnectionCallbackParams<TKey extends OnyxKey> = Parameters<ConnectionCallback<TKey>>; | ||
|
||
const reactNativeOnyxMock: ReactNativeOnyxMock = { | ||
...Onyx, | ||
connect: <TKey extends OnyxKey>(mapping: ConnectOptions<TKey>) => { | ||
const callback = (...params: ConnectionCallbackParams<TKey>) => { | ||
if (connectCallbackDelay > 0) { | ||
setTimeout(() => { | ||
(mapping.callback as (...args: ConnectionCallbackParams<TKey>) => void)?.(...params); | ||
}, connectCallbackDelay); | ||
} else { | ||
(mapping.callback as (...args: ConnectionCallbackParams<TKey>) => void)?.(...params); | ||
} | ||
}; | ||
return Onyx.connect({ | ||
...mapping, | ||
callback, | ||
}); | ||
}, | ||
addDelayToConnectCallback, | ||
}; | ||
|
||
export default reactNativeOnyxMock; | ||
export {withOnyx}; |
4 changes: 3 additions & 1 deletion
4
__mocks__/react-native-webview.js → __mocks__/react-native-webview.ts
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,6 +1,8 @@ | ||
import type {View as RNView} from 'react-native'; | ||
|
||
jest.mock('react-native-webview', () => { | ||
const {View} = require('react-native'); | ||
return { | ||
WebView: () => View, | ||
WebView: () => View as RNView, | ||
}; | ||
}); |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.