2020-06-29 14:58:43 +02:00
|
|
|
/* global jest */
|
|
|
|
|
2019-10-21 17:13:16 +02:00
|
|
|
jest.mock('react-native-watch-connectivity', () => {
|
|
|
|
return {
|
2020-09-07 13:35:08 +02:00
|
|
|
getIsWatchAppInstalled: jest.fn(() => Promise.resolve(false)),
|
2019-10-21 17:13:16 +02:00
|
|
|
subscribeToMessages: jest.fn(),
|
|
|
|
updateApplicationContext: jest.fn(),
|
2020-06-29 14:58:43 +02:00
|
|
|
};
|
|
|
|
});
|
2019-11-03 01:25:55 +01:00
|
|
|
|
2020-03-20 16:25:23 +01:00
|
|
|
jest.mock('react-native-secure-key-store', () => {
|
|
|
|
return {
|
|
|
|
setResetOnAppUninstallTo: jest.fn(),
|
2020-06-29 14:58:43 +02:00
|
|
|
};
|
|
|
|
});
|
2020-03-20 16:25:23 +01:00
|
|
|
|
2020-07-31 15:43:55 +02:00
|
|
|
jest.mock('@react-native-community/push-notification-ios', () => {
|
|
|
|
return {};
|
|
|
|
});
|
|
|
|
|
|
|
|
jest.mock('react-native-device-info', () => {
|
2020-08-11 02:27:14 +02:00
|
|
|
return {
|
|
|
|
getSystemName: jest.fn(),
|
2021-01-25 16:55:09 +01:00
|
|
|
hasGmsSync: jest.fn().mockReturnValue(true),
|
|
|
|
hasHmsSync: jest.fn().mockReturnValue(false),
|
2020-08-11 02:27:14 +02:00
|
|
|
};
|
2020-07-31 15:43:55 +02:00
|
|
|
});
|
|
|
|
|
2019-11-03 01:25:55 +01:00
|
|
|
jest.mock('react-native-quick-actions', () => {
|
|
|
|
return {
|
|
|
|
clearShortcutItems: jest.fn(),
|
|
|
|
setQuickActions: jest.fn(),
|
|
|
|
isSupported: jest.fn(),
|
2020-06-29 14:58:43 +02:00
|
|
|
};
|
|
|
|
});
|
2019-11-03 01:25:55 +01:00
|
|
|
|
|
|
|
jest.mock('react-native-default-preference', () => {
|
|
|
|
return {
|
|
|
|
setName: jest.fn(),
|
|
|
|
set: jest.fn(),
|
2020-06-29 14:58:43 +02:00
|
|
|
};
|
|
|
|
});
|
2020-02-25 13:36:49 +01:00
|
|
|
|
|
|
|
jest.mock('react-native-fs', () => {
|
|
|
|
return {
|
|
|
|
mkdir: jest.fn(),
|
|
|
|
moveFile: jest.fn(),
|
|
|
|
copyFile: jest.fn(),
|
|
|
|
pathForBundle: jest.fn(),
|
|
|
|
pathForGroup: jest.fn(),
|
|
|
|
getFSInfo: jest.fn(),
|
|
|
|
getAllExternalFilesDirs: jest.fn(),
|
|
|
|
unlink: jest.fn(),
|
|
|
|
exists: jest.fn(),
|
|
|
|
stopDownload: jest.fn(),
|
|
|
|
resumeDownload: jest.fn(),
|
|
|
|
isResumable: jest.fn(),
|
|
|
|
stopUpload: jest.fn(),
|
|
|
|
completeHandlerIOS: jest.fn(),
|
|
|
|
readDir: jest.fn(),
|
|
|
|
readDirAssets: jest.fn(),
|
|
|
|
existsAssets: jest.fn(),
|
|
|
|
readdir: jest.fn(),
|
|
|
|
setReadable: jest.fn(),
|
|
|
|
stat: jest.fn(),
|
|
|
|
readFile: jest.fn(),
|
|
|
|
read: jest.fn(),
|
|
|
|
readFileAssets: jest.fn(),
|
|
|
|
hash: jest.fn(),
|
|
|
|
copyFileAssets: jest.fn(),
|
|
|
|
copyFileAssetsIOS: jest.fn(),
|
|
|
|
copyAssetsVideoIOS: jest.fn(),
|
|
|
|
writeFile: jest.fn(),
|
|
|
|
appendFile: jest.fn(),
|
|
|
|
write: jest.fn(),
|
|
|
|
downloadFile: jest.fn(),
|
|
|
|
uploadFiles: jest.fn(),
|
|
|
|
touch: jest.fn(),
|
|
|
|
MainBundlePath: jest.fn(),
|
|
|
|
CachesDirectoryPath: jest.fn(),
|
|
|
|
DocumentDirectoryPath: jest.fn(),
|
|
|
|
ExternalDirectoryPath: jest.fn(),
|
|
|
|
ExternalStorageDirectoryPath: jest.fn(),
|
|
|
|
TemporaryDirectoryPath: jest.fn(),
|
|
|
|
LibraryDirectoryPath: jest.fn(),
|
|
|
|
PicturesDirectoryPath: jest.fn(),
|
2020-06-29 14:58:43 +02:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
jest.mock('react-native-gesture-handler', () => jest.requireActual('react-native-gesture-handler/__mocks__/RNGestureHandlerModule.js'));
|
2020-09-19 17:04:19 +02:00
|
|
|
|
|
|
|
jest.mock('react-native-document-picker', () => ({}));
|
2020-09-22 18:00:36 +02:00
|
|
|
|
|
|
|
jest.mock('react-native-haptic-feedback', () => ({}));
|
2020-12-20 00:23:20 +01:00
|
|
|
|
|
|
|
const realmInstanceMock = {
|
|
|
|
close: function () {},
|
2021-04-27 21:37:23 +02:00
|
|
|
write: function () {},
|
|
|
|
objectForPrimaryKey: function () { return {}; },
|
2020-12-20 00:23:20 +01:00
|
|
|
objects: function () {
|
|
|
|
const wallets = {
|
|
|
|
filtered: function () {
|
|
|
|
return [];
|
|
|
|
},
|
|
|
|
};
|
|
|
|
return wallets;
|
|
|
|
},
|
|
|
|
};
|
|
|
|
jest.mock('realm', () => {
|
|
|
|
return {
|
|
|
|
open: jest.fn(() => realmInstanceMock),
|
|
|
|
};
|
|
|
|
});
|
2021-03-25 16:28:25 +01:00
|
|
|
|
|
|
|
jest.mock('react-native-idle-timer', () => {
|
|
|
|
return {
|
|
|
|
setIdleTimerDisabled: jest.fn(),
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
jest.mock('react-native-haptic-feedback', () => {
|
|
|
|
return {
|
|
|
|
trigger: jest.fn(),
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
jest.mock('../blue_modules/analytics', () => {
|
|
|
|
const ret = jest.fn();
|
|
|
|
ret.ENUM = { CREATED_WALLET: '' };
|
|
|
|
return ret;
|
|
|
|
});
|
|
|
|
|
2021-04-19 12:24:04 +02:00
|
|
|
jest.mock('react-native-share', () => {
|
|
|
|
return {
|
|
|
|
open: jest.fn(),
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
2021-03-25 16:28:25 +01:00
|
|
|
global.alert = () => {};
|