Skip to content

Commit

Permalink
Merge branch 'Expensify:main' into fix-focus-behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
shubham1206agra authored Feb 13, 2024
2 parents c3e679e + 07d97ef commit bab646b
Show file tree
Hide file tree
Showing 278 changed files with 4,567 additions and 6,468 deletions.
2 changes: 1 addition & 1 deletion .storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = ({config}) => {
config.resolve.alias = {
'react-native-config': 'react-web-config',
'react-native$': 'react-native-web',
'@react-native-community/netinfo': path.resolve(__dirname, '../__mocks__/@react-native-community/netinfo.js'),
'@react-native-community/netinfo': path.resolve(__dirname, '../__mocks__/@react-native-community/netinfo.ts'),
'@react-navigation/native': path.resolve(__dirname, '../__mocks__/@react-navigation/native'),

// Module alias support for storybook files, coping from `webpack.common.js`
Expand Down
1 change: 0 additions & 1 deletion __mocks__/@react-native-async-storage/async-storage.js

This file was deleted.

3 changes: 3 additions & 0 deletions __mocks__/@react-native-clipboard/clipboard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import MockClipboard from '@react-native-clipboard/clipboard/jest/clipboard-mock';

export default MockClipboard;
19 changes: 0 additions & 19 deletions __mocks__/@react-native-community/netinfo.js

This file was deleted.

31 changes: 31 additions & 0 deletions __mocks__/@react-native-community/netinfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import {NetInfoCellularGeneration, NetInfoStateType} from '@react-native-community/netinfo';
import type {addEventListener, configure, fetch, NetInfoState, refresh, useNetInfo} from '@react-native-community/netinfo';

const defaultState: NetInfoState = {
type: NetInfoStateType.cellular,
isConnected: true,
isInternetReachable: true,
details: {
isConnectionExpensive: true,
cellularGeneration: NetInfoCellularGeneration['3g'],
carrier: 'T-Mobile',
},
};

type NetInfoMock = {
configure: typeof configure;
fetch: typeof fetch;
refresh: typeof refresh;
addEventListener: typeof addEventListener;
useNetInfo: typeof useNetInfo;
};

const netInfoMock: NetInfoMock = {
configure: () => {},
fetch: () => Promise.resolve(defaultState),
refresh: () => Promise.resolve(defaultState),
addEventListener: () => () => {},
useNetInfo: () => defaultState,
};

export default netInfoMock;
1 change: 0 additions & 1 deletion __mocks__/fileMock.js

This file was deleted.

3 changes: 3 additions & 0 deletions __mocks__/fileMock.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const fileMock = 'test-file-stub';

export default fileMock;
1 change: 0 additions & 1 deletion __mocks__/react-native-blob-util.js

This file was deleted.

5 changes: 5 additions & 0 deletions __mocks__/react-native-blob-util.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import type RNFetchBlob from 'react-native-blob-util';

const ReactNativeBlobUtilMock: Partial<typeof RNFetchBlob> = {};

export default ReactNativeBlobUtilMock;
6 changes: 0 additions & 6 deletions __mocks__/react-native-config.js

This file was deleted.

8 changes: 8 additions & 0 deletions __mocks__/react-native-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import dotenv from 'dotenv';
import path from 'path';

type ReactNativeConfigMock = dotenv.DotenvParseOutput | undefined;

const reactNativeConfigMock: ReactNativeConfigMock = dotenv.config({path: path.resolve('./.env.example')}).parsed;

export default reactNativeConfigMock;
3 changes: 0 additions & 3 deletions __mocks__/react-native-device-info.js

This file was deleted.

6 changes: 6 additions & 0 deletions __mocks__/react-native-device-info.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import type DeviceInfoModule from 'react-native-device-info';
import MockDeviceInfo from 'react-native-device-info/jest/react-native-device-info-mock';

const DeviceInfo: typeof DeviceInfoModule = MockDeviceInfo;

export default DeviceInfo;
23 changes: 23 additions & 0 deletions __mocks__/react-native-document-picker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
export default {
getConstants: jest.fn(),
pick: jest.fn(),
releaseSecureAccess: jest.fn(),
pickDirectory: jest.fn(),

types: Object.freeze({
allFiles: 'public.item',
audio: 'public.audio',
csv: 'public.comma-separated-values-text',
doc: 'com.microsoft.word.doc',
docx: 'org.openxmlformats.wordprocessingml.document',
images: 'public.image',
pdf: 'com.adobe.pdf',
plainText: 'public.plain-text',
ppt: 'com.microsoft.powerpoint.ppt',
pptx: 'org.openxmlformats.presentationml.presentation',
video: 'public.movie',
xls: 'com.microsoft.excel.xls',
xlsx: 'org.openxmlformats.spreadsheetml.sheet',
zip: 'public.zip-archive',
}),
};
5 changes: 0 additions & 5 deletions __mocks__/react-native-image-picker.js

This file was deleted.

7 changes: 0 additions & 7 deletions __mocks__/react-native-key-command.js

This file was deleted.

9 changes: 9 additions & 0 deletions __mocks__/react-native-key-command.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {addListener as _addListener, constants as _constants} from 'react-native-key-command';

const registerKeyCommands = () => {};
const unregisterKeyCommands = () => {};
const constants: Partial<typeof _constants> = {};
const eventEmitter = () => {};
const addListener: typeof _addListener = () => () => {};

export {addListener, constants, eventEmitter, registerKeyCommands, unregisterKeyCommands};
3 changes: 0 additions & 3 deletions __mocks__/react-native-localize.js

This file was deleted.

3 changes: 3 additions & 0 deletions __mocks__/react-native-localize.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import mockRNLocalize from 'react-native-localize/mock';

module.exports = mockRNLocalize;
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
multiDexEnabled rootProject.ext.multiDexEnabled
versionCode 1001043900
versionName "1.4.39-0"
versionCode 1001044002
versionName "1.4.40-2"
}

flavorDimensions "default"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,5 @@ public void onAirshipReady(@NonNull Context context, @NonNull UAirship airship)

CustomNotificationProvider notificationProvider = new CustomNotificationProvider(context, airship.getAirshipConfigOptions());
pushManager.setNotificationProvider(notificationProvider);

NotificationListener notificationListener = airship.getPushManager().getNotificationListener();
pushManager.setNotificationListener(new CustomNotificationListener(notificationListener, notificationProvider));
}
}

This file was deleted.

Loading

0 comments on commit bab646b

Please sign in to comment.