completion
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
/* global jest: true */
|
||||
|
||||
jest.mock('@react-native-community/async-storage', () => ({
|
||||
getItem: () => Promise.resolve(),
|
||||
setItem: () => Promise.resolve(),
|
||||
mergeItem: () => Promise.resolve(),
|
||||
removeItem: () => Promise.resolve(),
|
||||
}));
|
||||
@@ -0,0 +1,11 @@
|
||||
/* global jest: true */
|
||||
|
||||
const geolocation = {
|
||||
setRNConfiguration: jest.fn(() => {}),
|
||||
getCurrentPosition: jest.fn(() => {}),
|
||||
watchPosition: jest.fn(() => {}),
|
||||
clearWatch: jest.fn(() => {}),
|
||||
stopObserving: jest.fn(() => {}),
|
||||
};
|
||||
|
||||
export default geolocation;
|
||||
@@ -0,0 +1,35 @@
|
||||
/* global jest: false */
|
||||
import { NativeModules } from 'react-native';
|
||||
|
||||
jest.mock('@react-native-community/google-signin', () => {
|
||||
const mockGoogleSignin = require.requireActual('@react-native-community/google-signin');
|
||||
|
||||
mockGoogleSignin.GoogleSignin.hasPlayServices = () => Promise.resolve(true);
|
||||
mockGoogleSignin.GoogleSignin.configure = () => Promise.resolve();
|
||||
mockGoogleSignin.GoogleSignin.currentUserAsync = () => Promise.resolve({
|
||||
name: 'name',
|
||||
email: 'test@example.com',
|
||||
// .... other user data
|
||||
});
|
||||
|
||||
// ... and other functions you want to mock
|
||||
|
||||
return mockGoogleSignin;
|
||||
});
|
||||
|
||||
NativeModules.RNGoogleSignin = {
|
||||
BUTTON_SIZE_ICON: 0,
|
||||
BUTTON_SIZE_STANDARD: 0,
|
||||
BUTTON_SIZE_WIDE: 0,
|
||||
BUTTON_COLOR_AUTO: 0,
|
||||
BUTTON_COLOR_LIGHT: 0,
|
||||
BUTTON_COLOR_DARK: 0,
|
||||
SIGN_IN_CANCELLED: '0',
|
||||
IN_PROGRESS: '1',
|
||||
PLAY_SERVICES_NOT_AVAILABLE: '2',
|
||||
SIGN_IN_REQUIRED: '3',
|
||||
configure: jest.fn(),
|
||||
currentUserAsync: jest.fn(),
|
||||
};
|
||||
|
||||
export { NativeModules };
|
||||
@@ -0,0 +1,7 @@
|
||||
/* global jest: true */
|
||||
|
||||
jest.mock('@react-native-community/netinfo', () => ({
|
||||
getConnectionInfo: () => Promise.resolve(),
|
||||
addEventListener: jest.fn(),
|
||||
isConnected: jest.fn(),
|
||||
}));
|
||||
@@ -0,0 +1,5 @@
|
||||
/* global jest: true */
|
||||
|
||||
jest.mock('@react-native-community/push-notification-ios', () => ({
|
||||
|
||||
}));
|
||||
9
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-config.js
vendored
Normal file
9
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-config.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
// __mocks__/react-native-config.js
|
||||
export default {
|
||||
FOO_BAR: 'baz',
|
||||
FILE_SIZE_LIMIT: 20000000,
|
||||
MAX_WIDTH: 1820,
|
||||
MAX_HEIGHT: 1820,
|
||||
DEFAULT_VIDEO_LENGTH: 15,
|
||||
DEFAULT_MIN_VIDEO_LENGTH: 3,
|
||||
};
|
||||
16
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-creedon-imagepicker.js
vendored
Normal file
16
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-creedon-imagepicker.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
/* global jest: false */
|
||||
import { NativeModules } from 'react-native';
|
||||
|
||||
NativeModules.RNCreedonImagepicker = {
|
||||
assets: jest.fn(),
|
||||
launchImageLibrary: jest.fn(),
|
||||
cleanupTempFiles: jest.fn(),
|
||||
addListener: jest.fn(),
|
||||
};
|
||||
|
||||
const mockRNCreedonImagepicker = jest.genMockFromModule('react-native-creedon-imagepicker');
|
||||
mockRNCreedonImagepicker.assets = () => Promise.resolve();
|
||||
mockRNCreedonImagepicker.launchImageLibrary = () => Promise.resolve();
|
||||
mockRNCreedonImagepicker.cleanupTempFiles = () => Promise.resolve();
|
||||
|
||||
module.exports = mockRNCreedonImagepicker;
|
||||
12
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-device-info.js
vendored
Normal file
12
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-device-info.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
/* global jest: true */
|
||||
const deviceInfo = {
|
||||
getVersion: () => '1.0.0',
|
||||
getBuildNumber: () => '100',
|
||||
getUniqueID: () => '0',
|
||||
getDeviceId: () => '0',
|
||||
getModel: () => 'model',
|
||||
getIPAddress: jest.fn(),
|
||||
// add more methods as needed
|
||||
};
|
||||
|
||||
export default deviceInfo;
|
||||
14
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-firebase.js
vendored
Normal file
14
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-firebase.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/* global jest: true */
|
||||
|
||||
const firebase = {
|
||||
messaging: jest.fn(() => ({
|
||||
hasPermission: jest.fn(() => new Promise(resolve => resolve(true))),
|
||||
})),
|
||||
analytics: jest.fn(() => ({
|
||||
logEvent: jest.fn(),
|
||||
setUserId: jest.fn(),
|
||||
setUserProperties: jest.fn(),
|
||||
})),
|
||||
};
|
||||
|
||||
export default firebase;
|
||||
44
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-fs.js
vendored
Normal file
44
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-fs.js
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
/* global jest: true */
|
||||
jest.mock('react-native-fs', () => Promise.resolve({
|
||||
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(),
|
||||
}));
|
||||
14
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-gesture-handler.js
vendored
Normal file
14
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-gesture-handler.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/* global jest: false */
|
||||
jest.mock('NativeModules', () => ({
|
||||
UIManager: {
|
||||
RCTView: () => {},
|
||||
},
|
||||
RNGestureHandlerModule: {
|
||||
attachGestureHandler: jest.fn(),
|
||||
createGestureHandler: jest.fn(),
|
||||
dropGestureHandler: jest.fn(),
|
||||
updateGestureHandler: jest.fn(),
|
||||
State: {},
|
||||
Directions: {},
|
||||
},
|
||||
}));
|
||||
35
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-google-signin.js
vendored
Normal file
35
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-google-signin.js
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/* global jest: false */
|
||||
import { NativeModules } from 'react-native';
|
||||
|
||||
jest.mock('@react-native-community/google-signin', () => {
|
||||
const mockGoogleSignin = require.requireActual('@react-native-community/google-signin');
|
||||
|
||||
mockGoogleSignin.GoogleSignin.hasPlayServices = () => Promise.resolve(true);
|
||||
mockGoogleSignin.GoogleSignin.configure = () => Promise.resolve();
|
||||
mockGoogleSignin.GoogleSignin.currentUserAsync = () => Promise.resolve({
|
||||
name: 'name',
|
||||
email: 'test@example.com',
|
||||
// .... other user data
|
||||
});
|
||||
|
||||
// ... and other functions you want to mock
|
||||
|
||||
return mockGoogleSignin;
|
||||
});
|
||||
|
||||
NativeModules.RNGoogleSignin = {
|
||||
BUTTON_SIZE_ICON: 0,
|
||||
BUTTON_SIZE_STANDARD: 0,
|
||||
BUTTON_SIZE_WIDE: 0,
|
||||
BUTTON_COLOR_AUTO: 0,
|
||||
BUTTON_COLOR_LIGHT: 0,
|
||||
BUTTON_COLOR_DARK: 0,
|
||||
SIGN_IN_CANCELLED: '0',
|
||||
IN_PROGRESS: '1',
|
||||
PLAY_SERVICES_NOT_AVAILABLE: '2',
|
||||
SIGN_IN_REQUIRED: '3',
|
||||
configure: jest.fn(),
|
||||
currentUserAsync: jest.fn(),
|
||||
};
|
||||
|
||||
export { NativeModules };
|
||||
15
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-haptic-feedback.js
vendored
Normal file
15
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-haptic-feedback.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
/* global jest: false */
|
||||
jest.mock('react-native-haptic-feedback', () => ({
|
||||
trigger: jest.fn(),
|
||||
}));
|
||||
|
||||
// import { NativeModules } from 'react-native';
|
||||
|
||||
// NativeModules.RNReactNativeHapticFeedback = {
|
||||
// trigger: jest.fn(),
|
||||
// };
|
||||
|
||||
// const ReactNativeHapticFeedback = jest.genMockFromModule('react-native-haptic-feedback');
|
||||
|
||||
|
||||
// module.exports = ReactNativeHapticFeedback;
|
||||
5
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-keychain.js
vendored
Normal file
5
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-keychain.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
/* global jest: false */
|
||||
|
||||
export const setGenericPassword = () => jest.fn();
|
||||
export const getGenericPassword = () => jest.fn(Promise.resolve(''));
|
||||
export const resetGenericPassword = () => jest.fn();
|
||||
60
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-localize.js
vendored
Normal file
60
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-localize.js
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
/* global jest: true */
|
||||
// https://github.com/react-native-community/react-native-localize/blob/master/README.md#how-to-test-your-code
|
||||
const getLocales = () => [
|
||||
// you can choose / add the locales you want
|
||||
{
|
||||
countryCode: 'US',
|
||||
languageTag: 'en',
|
||||
languageCode: 'en',
|
||||
isRTL: false,
|
||||
},
|
||||
{
|
||||
countryCode: 'DE',
|
||||
languageTag: 'de',
|
||||
languageCode: 'de',
|
||||
isRTL: false,
|
||||
},
|
||||
{
|
||||
countryCode: 'JA',
|
||||
languageTag: 'ja',
|
||||
languageCode: 'ja',
|
||||
isRTL: false,
|
||||
},
|
||||
];
|
||||
|
||||
// use a provided translation, or return undefined to test your fallback
|
||||
const findBestAvailableLanguage = () => ({
|
||||
languageTag: 'en',
|
||||
isRTL: false,
|
||||
});
|
||||
|
||||
const getNumberFormatSettings = () => ({
|
||||
decimalSeparator: '.',
|
||||
groupingSeparator: ',',
|
||||
});
|
||||
|
||||
const getCalendar = () => 'gregorian'; // or 'japanese', 'buddhist'
|
||||
const getCountry = () => 'US'; // the country code you want
|
||||
const getCurrencies = () => ['USD', 'EUR']; // can be empty array
|
||||
const getTemperatureUnit = () => 'celsius'; // or 'fahrenheit'
|
||||
const getTimeZone = () => 'Europe/Paris'; // the timezone you want
|
||||
const uses24HourClock = () => true;
|
||||
const usesMetricSystem = () => true;
|
||||
|
||||
const addEventListener = jest.fn();
|
||||
const removeEventListener = jest.fn();
|
||||
|
||||
export {
|
||||
findBestAvailableLanguage,
|
||||
getLocales,
|
||||
getNumberFormatSettings,
|
||||
getCalendar,
|
||||
getCountry,
|
||||
getCurrencies,
|
||||
getTemperatureUnit,
|
||||
getTimeZone,
|
||||
uses24HourClock,
|
||||
usesMetricSystem,
|
||||
addEventListener,
|
||||
removeEventListener,
|
||||
};
|
||||
10
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-nixplay-core.js
vendored
Normal file
10
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-nixplay-core.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
/* global jest: true */
|
||||
const NixplayCore = jest.genMockFromModule('react-native-nixplay-core');
|
||||
|
||||
NixplayCore.setUploadSessionIdentifier = () => Promise.resolve();
|
||||
NixplayCore.setApiURL = () => Promise.resolve();
|
||||
NixplayCore.setBucketPrefix = () => Promise.resolve();
|
||||
NixplayCore.setFileSizeLimit = () => Promise.resolve();
|
||||
NixplayCore.startUpload = () => Promise.resolve();
|
||||
|
||||
export default NixplayCore;
|
||||
13
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-push-notification.js
vendored
Normal file
13
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-push-notification.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
/* global jest: true */
|
||||
|
||||
const PushNotification = jest.genMockFromModule('react-native-push-notification');
|
||||
|
||||
PushNotification.configure = jest.fn();
|
||||
PushNotification.onRegister = jest.fn();
|
||||
PushNotification.onNotification = jest.fn();
|
||||
PushNotification.addEventListener = jest.fn();
|
||||
PushNotification.requestPermissions = jest.fn();
|
||||
PushNotification.cancelAllLocalNotifications = jest.fn();
|
||||
PushNotification.setApplicationIconBadgeNumber = jest.fn();
|
||||
|
||||
export default PushNotification;
|
||||
3
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-reanimated.js
vendored
Normal file
3
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-reanimated.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
const NativeEventEmitter = {};
|
||||
|
||||
export default NativeEventEmitter;
|
||||
14
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-safe-area.js
vendored
Normal file
14
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-safe-area.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
/* global jest: true */
|
||||
const SafeArea = {};
|
||||
|
||||
SafeArea.getSafeAreaInsetsForRootView = () => ({
|
||||
safeAreaInsets: {
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
},
|
||||
});
|
||||
SafeArea.addEventListener = jest.fn();
|
||||
|
||||
export default SafeArea;
|
||||
7
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-share-extension.js
vendored
Normal file
7
ioneapps-maagapp-ee31119a522d/__mocks__/react-native-share-extension.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/* global jest: true */
|
||||
|
||||
const ShareExtension = {
|
||||
data: jest.fn(() => Promise.resolve({})),
|
||||
close: jest.fn(() => Promise.resolve(true)),
|
||||
};
|
||||
export default ShareExtension;
|
||||
@@ -0,0 +1,8 @@
|
||||
/* global jest: true */
|
||||
|
||||
const FilesystemStorage = {
|
||||
getItem: jest.fn(() => Promise.resolve()),
|
||||
setItem: jest.fn(() => Promise.resolve()),
|
||||
};
|
||||
|
||||
export default FilesystemStorage;
|
||||
Reference in New Issue
Block a user