Skip to content

Commit

Permalink
Merge branch 'main' of github.com:kubabutkiewicz/expensify-app into t…
Browse files Browse the repository at this point in the history
…s-migration/config
  • Loading branch information
kubabutkiewicz committed Mar 4, 2024
2 parents 8022390 + c061c11 commit ea8dab6
Show file tree
Hide file tree
Showing 239 changed files with 5,152 additions and 3,859 deletions.
9 changes: 7 additions & 2 deletions .github/actions/javascript/bumpVersion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2657,12 +2657,17 @@ createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)

// Coercion.
// Extract anything that could conceivably be a part of a valid semver
createToken('COERCE', `${'(^|[^\\d])' +
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
'(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
`(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
createToken('COERCEFULL', src[t.COERCEPLAIN] +
`(?:${src[t.PRERELEASE]})?` +
`(?:${src[t.BUILD]})?` +
`(?:$|[^\\d])`)
createToken('COERCERTL', src[t.COERCE], true)
createToken('COERCERTLFULL', src[t.COERCEFULL], true)

// Tilde ranges.
// Meaning is "reasonably at or greater than"
Expand Down
44 changes: 33 additions & 11 deletions __mocks__/react-native.js → __mocks__/react-native.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,47 @@
// eslint-disable-next-line no-restricted-imports
import * as ReactNative from 'react-native';
import _ from 'underscore';
import type StartupTimer from '@libs/StartupTimer/types';

const {BootSplash} = ReactNative.NativeModules;

jest.doMock('react-native', () => {
let url = 'https://new.expensify.com/';
const getInitialURL = () => Promise.resolve(url);

let appState = 'active';
let appState: ReactNative.AppStateStatus = 'active';
let count = 0;
const changeListeners = {};
const changeListeners: Record<number, (state: ReactNative.AppStateStatus) => void> = {};

// Tests will run with the app in a typical small screen size by default. We do this since the react-native test renderer
// runs against index.native.js source and so anything that is testing a component reliant on withWindowDimensions()
// would be most commonly assumed to be on a mobile phone vs. a tablet or desktop style view. This behavior can be
// overridden by explicitly setting the dimensions inside a test via Dimensions.set()
let dimensions = {
let dimensions: Record<string, number> = {
width: 300,
height: 700,
scale: 1,
fontScale: 1,
};

return Object.setPrototypeOf(
type ReactNativeMock = typeof ReactNative & {
NativeModules: typeof ReactNative.NativeModules & {
BootSplash: {
getVisibilityStatus: typeof BootSplash.getVisibilityStatus;
hide: typeof BootSplash.hide;
logoSizeRatio: number;
navigationBarHeight: number;
};
StartupTimer: StartupTimer;
};
Linking: typeof ReactNative.Linking & {
setInitialURL: (newUrl: string) => void;
};
AppState: typeof ReactNative.AppState & {
emitCurrentTestState: (state: ReactNative.AppStateStatus) => void;
};
};

const reactNativeMock: ReactNativeMock = Object.setPrototypeOf(
{
NativeModules: {
...ReactNative.NativeModules,
Expand All @@ -36,7 +56,7 @@ jest.doMock('react-native', () => {
Linking: {
...ReactNative.Linking,
getInitialURL,
setInitialURL(newUrl) {
setInitialURL(newUrl: string) {
url = newUrl;
},
},
Expand All @@ -45,11 +65,11 @@ jest.doMock('react-native', () => {
get currentState() {
return appState;
},
emitCurrentTestState(state) {
emitCurrentTestState(state: ReactNative.AppStateStatus) {
appState = state;
_.each(changeListeners, (listener) => listener(appState));
Object.entries(changeListeners).forEach(([, listener]) => listener(appState));
},
addEventListener(type, listener) {
addEventListener(type: ReactNative.AppStateEvent, listener: (state: ReactNative.AppStateStatus) => void) {
if (type === 'change') {
const originalCount = count;
changeListeners[originalCount] = listener;
Expand All @@ -68,7 +88,7 @@ jest.doMock('react-native', () => {
...ReactNative.Dimensions,
addEventListener: jest.fn(),
get: () => dimensions,
set: (newDimensions) => {
set: (newDimensions: Record<string, number>) => {
dimensions = newDimensions;
},
},
Expand All @@ -78,9 +98,11 @@ jest.doMock('react-native', () => {
// so it seems easier to just run the callback immediately in tests.
InteractionManager: {
...ReactNative.InteractionManager,
runAfterInteractions: (callback) => callback(),
runAfterInteractions: (callback: () => void) => callback(),
},
},
ReactNative,
);

return reactNativeMock;
});
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 1001044407
versionName "1.4.44-7"
versionCode 1001044600
versionName "1.4.46-0"
}

flavorDimensions "default"
Expand Down
11 changes: 10 additions & 1 deletion assets/images/chatbubble-add.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions assets/images/chatbubble-reply.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 9 additions & 1 deletion assets/images/chatbubble-unread.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions assets/images/make-admin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ea8dab6

Please sign in to comment.