forked from zingolabs/zingo-mobile
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request zingolabs#795 from juanky201271/dev_menu_moved_to_…
…drawer Menu moved to drawer & DRY tests
- Loading branch information
Showing
73 changed files
with
241 additions
and
2,109 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export const FontAwesomeIcon = ''; |
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,2 @@ | ||
export const getString = jest.fn(() => Promise.resolve('mocked clipboard content')); | ||
export const setString = jest.fn(); |
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,28 @@ | ||
const RN = jest.requireActual('react-native'); | ||
|
||
export const NetInfoStateType = { | ||
unknown: 'unknown', | ||
none: 'none', | ||
cellular: 'cellular', | ||
wifi: 'wifi', | ||
bluetooth: 'bluetooth', | ||
ethernet: 'ethernet', | ||
wimax: 'wimax', | ||
vpn: 'vpn', | ||
other: 'other', | ||
}; | ||
|
||
RN.NativeModules.RNCNetInfo = { | ||
execute: jest.fn(() => '{}'), | ||
}; | ||
|
||
export default { | ||
RNCNetInfo: RN, | ||
addEventListener: jest.fn(), | ||
fetch: jest.fn().mockImplementation(() => | ||
Promise.resolve({ | ||
isConnected: true, | ||
isInternetReachable: true, | ||
}), | ||
), | ||
}; |
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,28 @@ | ||
const RN = jest.requireActual('react-native'); | ||
|
||
export const NetInfoStateType = { | ||
unknown: 'unknown', | ||
none: 'none', | ||
cellular: 'cellular', | ||
wifi: 'wifi', | ||
bluetooth: 'bluetooth', | ||
ethernet: 'ethernet', | ||
wimax: 'wimax', | ||
vpn: 'vpn', | ||
other: 'other', | ||
}; | ||
|
||
RN.NativeModules.RNCNetInfo = { | ||
execute: jest.fn(() => '{}'), | ||
}; | ||
|
||
export default { | ||
RNCNetInfo: RN, | ||
addEventListener: jest.fn(), | ||
fetch: jest.fn().mockImplementation(() => | ||
Promise.resolve({ | ||
isConnected: true, | ||
isInternetReachable: true, | ||
}), | ||
), | ||
}; |
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,16 @@ | ||
import React from 'react'; | ||
|
||
const MockNavigator = ({ children }) => children; | ||
const MockScreen = ({ _name, children, component }) => { | ||
if (typeof children === 'function') { | ||
return children({ navigation: {} }); | ||
} | ||
|
||
const Component = component; | ||
return Component ? <Component /> : <>{children}</>; | ||
}; | ||
|
||
export const createDrawerNavigator = jest.fn(() => ({ | ||
Navigator: MockNavigator, | ||
Screen: MockScreen, | ||
})); |
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 @@ | ||
export const PlatformPressable = jest.fn().mockImplementation(({ children }) => children); |
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,7 @@ | ||
import { mockTheme } from '../dataMocks/mockTheme'; | ||
|
||
export const useTheme = () => (mockTheme); | ||
export const useScrollToTop = jest.fn(); | ||
export const useIsFocused = jest.fn(); | ||
|
||
export const NavigationContainer = ({ children }) => children; |
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,9 +1,5 @@ | ||
// @sayem314/react-native-keep-awake.js | ||
|
||
export const activateKeepAwake = jest.fn().mockImplementation(() => { | ||
console.log('Mocked activateKeepAwake'); | ||
}); | ||
export const activateKeepAwake = jest.fn().mockImplementation(() => {}); | ||
|
||
export const deactivateKeepAwake = jest.fn().mockImplementation(() => { | ||
console.log('Mocked deactivateKeepAwake'); | ||
}); | ||
export const deactivateKeepAwake = jest.fn().mockImplementation(() => {}); |
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
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,17 @@ | ||
const mMoment = { | ||
format: (p) => { | ||
if (p === 'MMM YYYY') { | ||
return 'Dec 2022'; | ||
} else if (p === 'YYYY MMM D h:mm a') { | ||
return '2022 Dec 13 8:00 am'; | ||
} else if (p === 'MMM D, h:mm a') { | ||
return 'Dec 13, 8:00 am'; | ||
} | ||
}, | ||
}; | ||
const fn = () => { | ||
return mMoment; | ||
}; | ||
fn.default = fn; | ||
fn.locale = jest.fn(); | ||
export default fn; |
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,3 @@ | ||
export default () => () => ({ | ||
defineLocale: jest.fn(), | ||
}); |
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,3 @@ | ||
export default () => () => ({ | ||
defineLocale: jest.fn(), | ||
}); |
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,3 @@ | ||
export default () => () => ({ | ||
defineLocale: jest.fn(), | ||
}); |
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 @@ | ||
export default () => 'BouncyCheckbox'; |
Empty file.
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,4 @@ | ||
export const getSystemName = jest.fn(() => 'Mocked System Name'); | ||
export const getSystemVersion = jest.fn(() => 'Mocked System Version'); | ||
export const getManufacturer = jest.fn(() => 'Mocked Manufacturer'); | ||
export const getModel = jest.fn(() => 'Mocked Model'); |
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 @@ | ||
export const requestBioAuth = jest.fn(() => Promise.resolve(true)); |
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,2 @@ | ||
export const readFile = jest.fn(() => Promise.resolve('{}')); | ||
export const writeFile = jest.fn(() => Promise.resolve()); |
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,16 @@ | ||
export const GestureHandlerRootView = ({ children }) => children; | ||
|
||
export default { | ||
Swipeable: jest.fn().mockImplementation(({ children }) => children), | ||
RNGestureHandlerModule: { | ||
attachGestureHandler: jest.fn(), | ||
createGestureHandler: jest.fn(), | ||
dropGestureHandler: jest.fn(), | ||
updateGestureHandler: jest.fn(), | ||
forceTouchAvailable: jest.fn(), | ||
hasGenericPassword: jest.fn(), | ||
getSupportedBiometryType: jest.fn(), | ||
State: {}, | ||
Directions: {}, | ||
}, | ||
}; |
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 @@ | ||
export const PieChart = jest.fn().mockReturnValue(null); |
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,24 @@ | ||
export const ACCESS_CONTROL = { | ||
BIOMETRY_CURRENT_SET: 'biometryCurrentSet', | ||
}; | ||
export const ACCESSIBLE = { | ||
WHEN_UNLOCKED_THIS_DEVICE_ONLY: 'whenUnlockedThisDeviceOnly', | ||
}; | ||
export const AUTHENTICATION_TYPE = { | ||
BIOMETRICS: 'biometrics', | ||
}; | ||
export const SECURITY_LEVEL = { | ||
SECURE_SOFTWARE: 'secureSoftware', | ||
}; | ||
export const SECURITY_RULES = { | ||
NONE: 'none', | ||
}; | ||
export const STORAGE_TYPE = { | ||
RSA : 'RSA', | ||
AES_GCM_NO_AUTH: 'AES_GCM_NO_AUTH', | ||
}; | ||
export const setGenericPassword = jest.fn(); | ||
export const getGenericPassword = jest.fn(); | ||
export const resetGenericPassword = jest.fn(); | ||
export const getSupportedBiometryType = jest.fn(); | ||
export const hasGenericPassword = jest.fn(); |
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,6 @@ | ||
export const getNumberFormatSettings = () => { | ||
return { | ||
decimalSeparator: '.', // us | ||
groupingSeparator: ',', // us | ||
}; | ||
}; |
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 @@ | ||
export default () => 'RNPickerSelect'; |
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,3 @@ | ||
export const SafeAreaProvider = ({ children }) => children; | ||
export const SafeAreaView = ({ children }) => children; | ||
export const useSafeAreaInsets = () => ({ top: 0, left: 0, right: 0, bottom: 0 }); |
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,10 +1,4 @@ | ||
// react-native-snackbar.js | ||
|
||
export default { | ||
show: jest.fn().mockImplementation(message => { | ||
console.log(`Mocked Snackbar show: ${message}`); | ||
}), | ||
dismiss: jest.fn().mockImplementation(() => { | ||
console.log('Mocked Snackbar dismiss'); | ||
}), | ||
show: jest.fn().mockImplementation(() => {}), | ||
dismiss: jest.fn().mockImplementation(() => {}), | ||
}; |
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,2 @@ | ||
export const TabView = ''; | ||
export const TabBar = ''; |
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,16 @@ | ||
jest.mock('react-native', () => { | ||
const RN = jest.requireActual('react-native'); | ||
|
||
RN.NativeModules.RPCModule = { | ||
execute: jest.fn(() => '{}'), | ||
getLatestBlock: jest.fn(() => '{}'), | ||
walletExists: jest.fn(() => 'false'), | ||
getValueTransfersList: jest.fn(() => '{ "value_transfers": [], "total": 0 }'), | ||
setCryptoDefaultProvider: jest.fn(() => 'true'), | ||
createNewWallet: jest.fn(() => '{ "seed": "seed phrase test", "birthday": 0 }'), | ||
doSave: jest.fn(), | ||
}; | ||
RN.View = jest.fn(); | ||
|
||
return RN; | ||
}); |
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
Oops, something went wrong.