Skip to content

Commit 1e73388

Browse files
authored
chore: Merge 4.62.0 into master (#6468)
2 parents 246363f + a4875e1 commit 1e73388

File tree

224 files changed

+134597
-3307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+134597
-3307
lines changed

.detoxrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
artifacts: {
1111
plugins: {
1212
screenshot: 'failing',
13-
video: 'failing',
13+
video: 'all',
1414
uiHierarchy: process.env.CI ? undefined : 'enabled'
1515
}
1616
},
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Lint and Unit Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '*'
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
lint-testunit:
14+
if: ${{ github.repository == 'RocketChat/Rocket.Chat.ReactNative' }}
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 'lts/*'
27+
cache: 'yarn'
28+
29+
- name: Cache node_modules
30+
uses: actions/cache@v4
31+
with:
32+
path: node_modules
33+
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
34+
restore-keys: |
35+
${{ runner.os }}-node-modules-${{ hashFiles('**/yarn.lock') }}
36+
37+
- name: Install dependencies
38+
run: yarn install --frozen-lockfile
39+
40+
- name: Run ESLint
41+
run: yarn lint
42+
43+
- name: Run Tests
44+
run: yarn test --runInBand

.github/workflows/prettier.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
fi
5353
5454
- name: Commit and push changes
55-
if: env.changes == 'true'
55+
if: steps.check_changes.outputs.changes == 'true'
5656
run: |
5757
git config user.name "${{ github.actor }}"
5858
git config user.email "${{ github.actor }}@users.noreply.github.com"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ local.properties
5252
*.keystore
5353
*.jks
5454
!debug.keystore
55+
.kotlin/
5556

5657
# node.js
5758
#

.rnstorybook/generateSnapshots.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react';
2+
import { composeStories } from '@storybook/react';
3+
import { render } from '@testing-library/react-native';
4+
import preview from './preview';
5+
import { mockedStore } from '../app/reducers/mockedStore';
6+
import { initStore } from '../app/lib/store/auxStore';
7+
8+
initStore(mockedStore);
9+
10+
export function generateSnapshots(stories: any) {
11+
describe('Story Snapshots:', () => {
12+
const composedStories = composeStories(stories, {
13+
decorators: preview.decorators
14+
});
15+
Object.entries(composedStories).forEach(([name, story]) => {
16+
test(`${name} should match snapshot`, () => {
17+
const rendered = render(React.createElement(story as React.ComponentType));
18+
expect(rendered.toJSON()).toMatchSnapshot();
19+
});
20+
});
21+
});
22+
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { view } from './storybook.requires';
33
import RNBootSplash from 'react-native-bootsplash';
44

55
const StorybookUIRoot = view.getStorybookUI({
6-
storage: {
7-
getItem: AsyncStorage.getItem,
8-
setItem: AsyncStorage.setItem,
9-
},
6+
storage: {
7+
getItem: AsyncStorage.getItem,
8+
setItem: AsyncStorage.setItem
9+
}
1010
});
1111

1212
RNBootSplash.hide();
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { StorybookConfig } from '@storybook/react-native';
22

33
const main: StorybookConfig = {
4-
stories: ['../app/**/*.stories.?(ts|tsx|js|jsx)'],
5-
addons: [],
4+
stories: ['../app/**/*.stories.?(ts|tsx|js|jsx)'],
5+
addons: []
66
};
77

88
export default main;

.rnstorybook/preview.tsx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import React from 'react';
2+
import type { Preview } from '@storybook/react';
3+
import { Provider } from 'react-redux';
4+
import { GestureHandlerRootView } from 'react-native-gesture-handler';
5+
6+
import { themes } from '../app/lib/constants';
7+
import MessageContext from '../app/containers/message/Context';
8+
import { selectServerRequest } from '../app/actions/server';
9+
import { mockedStore as store } from '../app/reducers/mockedStore';
10+
import { setUser } from '../app/actions/login';
11+
12+
const baseUrl = 'https://open.rocket.chat';
13+
store.dispatch(selectServerRequest(baseUrl, '7.0.0'));
14+
store.dispatch(setUser({ id: 'abc', username: 'rocket.cat', name: 'Rocket Cat' }));
15+
16+
const preview: Preview = {
17+
decorators: [
18+
Story => (
19+
<Provider store={store}>
20+
<MessageContext.Provider
21+
value={{
22+
user: {
23+
id: 'y8bd77ptZswPj3EW8',
24+
username: 'diego.mello',
25+
token: 'abc'
26+
},
27+
baseUrl,
28+
onPress: () => {},
29+
onLongPress: () => {},
30+
reactionInit: () => {},
31+
onErrorPress: () => {},
32+
replyBroadcast: () => {},
33+
onReactionPress: () => {},
34+
onDiscussionPress: () => {},
35+
onReactionLongPress: () => {},
36+
threadBadgeColor: themes.light.badgeBackgroundLevel1
37+
}}>
38+
<Story />
39+
</MessageContext.Provider>
40+
</Provider>
41+
)
42+
]
43+
};
44+
45+
export default preview;

.rnstorybook/storybook.requires.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* do not change this file, it is auto generated by storybook. */
2+
import { start, updateView, View } from '@storybook/react-native';
3+
4+
const normalizedStories = [
5+
{
6+
titlePrefix: '',
7+
directory: './app',
8+
files: '**/*.stories.?(ts|tsx|js|jsx)',
9+
importPathMatcher: /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/,
10+
// @ts-ignore
11+
req: require.context(
12+
'../app',
13+
true,
14+
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/
15+
)
16+
}
17+
];
18+
19+
declare global {
20+
var view: View;
21+
var STORIES: typeof normalizedStories;
22+
}
23+
24+
const annotations = [require('./preview'), require('@storybook/react-native/preview')];
25+
26+
global.STORIES = normalizedStories;
27+
28+
// @ts-ignore
29+
module?.hot?.accept?.();
30+
31+
if (!global.view) {
32+
global.view = start({
33+
annotations,
34+
storyEntries: normalizedStories
35+
});
36+
} else {
37+
updateView(global.view, annotations, normalizedStories);
38+
}
39+
40+
export const view: View = global.view;

0 commit comments

Comments
 (0)