Skip to content

Commit

Permalink
Fixed eslint changed files check
Browse files Browse the repository at this point in the history
  • Loading branch information
zfurtak committed Sep 20, 2024
1 parent f8fbbcc commit a5bc7a4
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 38 deletions.
10 changes: 5 additions & 5 deletions tests/perf-test/BaseOptionsList.perf-test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {fireEvent} from '@testing-library/react-native';
import type {RenderResult} from '@testing-library/react-native';
import React, {useState} from 'react';
import {measurePerformance} from 'reassure';
import {measureRenders} from 'reassure';
import BaseOptionsList from '@components/OptionsList/BaseOptionsList';
import type {OptionData} from '@libs/ReportUtils';
import variables from '@styles/variables';
Expand Down Expand Up @@ -67,7 +67,7 @@ describe('[BaseOptionsList]', () => {
}

test('Should render 1 section and a thousand items', () => {
measurePerformance(<BaseOptionsListWrapper />);
measureRenders(<BaseOptionsListWrapper />);
});

test('Should press a list item', () => {
Expand All @@ -76,7 +76,7 @@ describe('[BaseOptionsList]', () => {
fireEvent.press(screen.getByText('Item 5'));
};

measurePerformance(<BaseOptionsListWrapper />, {scenario});
measureRenders(<BaseOptionsListWrapper />, {scenario});
});

test('Should render multiple selection and select 4 items', () => {
Expand All @@ -88,7 +88,7 @@ describe('[BaseOptionsList]', () => {
fireEvent.press(screen.getByText('Item 4'));
};

measurePerformance(<BaseOptionsListWrapper canSelectMultipleOptions />, {scenario});
measureRenders(<BaseOptionsListWrapper canSelectMultipleOptions />, {scenario});
});

test('Should scroll and select a few items', () => {
Expand Down Expand Up @@ -120,6 +120,6 @@ describe('[BaseOptionsList]', () => {
fireEvent.press(screen.getByText('Item 15'));
};

measurePerformance(<BaseOptionsListWrapper canSelectMultipleOptions />, {scenario});
measureRenders(<BaseOptionsListWrapper canSelectMultipleOptions />, {scenario});
});
});
6 changes: 3 additions & 3 deletions tests/perf-test/ChatFinderPage.perf-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, {useMemo} from 'react';
import type {ComponentType} from 'react';
import Onyx from 'react-native-onyx';
import type {OnyxCollection, OnyxEntry} from 'react-native-onyx';
import {measurePerformance} from 'reassure';
import {measureRenders} from 'reassure';
import {LocaleContextProvider} from '@components/LocaleContextProvider';
import OptionListContextProvider, {OptionsListContext} from '@components/OptionListContextProvider';
import {KeyboardStateProvider} from '@components/withKeyboardState';
Expand Down Expand Up @@ -187,7 +187,7 @@ test('[ChatFinderPage] should render list with cached options', async () => {
}),
)
.then(() =>
measurePerformance(
measureRenders(
<ChatFinderPageWithCachedOptions
route={{key: 'ChatFinder_Root', name: 'ChatFinder'}}
navigation={navigation}
Expand Down Expand Up @@ -221,7 +221,7 @@ test('[ChatFinderPage] should interact when text input changes', async () => {
}),
)
.then(() =>
measurePerformance(
measureRenders(
<ChatFinderPageWrapper
route={{key: 'ChatFinder_Root', name: 'ChatFinder'}}
navigation={navigation}
Expand Down
4 changes: 2 additions & 2 deletions tests/perf-test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ We use Reassure for monitoring performance regression. It helps us check if our
- Reassure builds on the existing React Testing Library setup and adds a performance measurement functionality. It's intended to be used on local machine and on a remote server as part of your continuous integration setup.
- To make sure the results are reliable and consistent, Reassure runs tests twice – once for the current branch and once for the base branch.

## Performance Testing Strategy (`measurePerformance`)
## Performance Testing Strategy (`measureRenders`)

- The primary focus is on testing business cases rather than small, reusable parts that typically don't introduce regressions, although some tests in that area are still necessary.
- To achieve this goal, it's recommended to stay relatively high up in the React tree, targeting whole screens to recreate real-life scenarios that users may encounter.
Expand Down Expand Up @@ -84,7 +84,7 @@ test('Count increments on press', async () => {
await screen.findByText('Count: 2');
};

await measurePerformance(
await measureRenders(
<Counter />,
{ scenario, runs: 20 }
);
Expand Down
20 changes: 10 additions & 10 deletions tests/perf-test/ReportActionCompose.perf-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type {ComponentType, EffectCallback} from 'react';
import React from 'react';
import Onyx from 'react-native-onyx';
import type Animated from 'react-native-reanimated';
import {measurePerformance} from 'reassure';
import {measureRenders} from 'reassure';
import type {WithNavigationFocusProps} from '@components/withNavigationFocus';
import type {EmojiPickerRef} from '@libs/actions/EmojiPickerAction';
import type Navigation from '@libs/Navigation/Navigation';
Expand Down Expand Up @@ -105,7 +105,7 @@ test('[ReportActionCompose] should render Composer with text input interactions'
};

await waitForBatchedUpdates();
await measurePerformance(<ReportActionComposeWrapper />, {scenario});
await measureRenders(<ReportActionComposeWrapper />, {scenario});
});

test('[ReportActionCompose] should scroll to hide suggestions', async () => {
Expand All @@ -118,7 +118,7 @@ test('[ReportActionCompose] should scroll to hide suggestions', async () => {
};

await waitForBatchedUpdates();
await measurePerformance(<ReportActionComposeWrapper />, {scenario});
await measureRenders(<ReportActionComposeWrapper />, {scenario});
});

test('[ReportActionCompose] should press to block suggestions', async () => {
Expand All @@ -131,7 +131,7 @@ test('[ReportActionCompose] should press to block suggestions', async () => {
};

await waitForBatchedUpdates();
await measurePerformance(<ReportActionComposeWrapper />, {scenario});
await measureRenders(<ReportActionComposeWrapper />, {scenario});
});

test('[ReportActionCompose] should press add attachemnt button', async () => {
Expand All @@ -144,7 +144,7 @@ test('[ReportActionCompose] should press add attachemnt button', async () => {
};

await waitForBatchedUpdates();
await measurePerformance(<ReportActionComposeWrapper />, {scenario});
await measureRenders(<ReportActionComposeWrapper />, {scenario});
});

test('[ReportActionCompose] should press add emoji button', async () => {
Expand All @@ -157,7 +157,7 @@ test('[ReportActionCompose] should press add emoji button', async () => {
};

await waitForBatchedUpdates();
await measurePerformance(<ReportActionComposeWrapper />, {scenario});
await measureRenders(<ReportActionComposeWrapper />, {scenario});
});

test('[ReportActionCompose] should press send message button', async () => {
Expand All @@ -170,7 +170,7 @@ test('[ReportActionCompose] should press send message button', async () => {
};

await waitForBatchedUpdates();
await measurePerformance(<ReportActionComposeWrapper />, {scenario});
await measureRenders(<ReportActionComposeWrapper />, {scenario});
});

test('[ReportActionCompose] press add attachment button', async () => {
Expand All @@ -182,7 +182,7 @@ test('[ReportActionCompose] press add attachment button', async () => {
};

await waitForBatchedUpdates();
await measurePerformance(<ReportActionComposeWrapper />, {scenario});
await measureRenders(<ReportActionComposeWrapper />, {scenario});
});

test('[ReportActionCompose] should press split bill button', async () => {
Expand All @@ -193,7 +193,7 @@ test('[ReportActionCompose] should press split bill button', async () => {
};

await waitForBatchedUpdates();
await measurePerformance(<ReportActionComposeWrapper />, {scenario});
await measureRenders(<ReportActionComposeWrapper />, {scenario});
});

test('[ReportActionCompose] should press assign task button', async () => {
Expand All @@ -204,5 +204,5 @@ test('[ReportActionCompose] should press assign task button', async () => {
};

await waitForBatchedUpdates();
await measurePerformance(<ReportActionComposeWrapper />, {scenario});
await measureRenders(<ReportActionComposeWrapper />, {scenario});
});
8 changes: 4 additions & 4 deletions tests/perf-test/ReportActionsList.perf-test.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {fireEvent, screen} from '@testing-library/react-native';
import type {ComponentType} from 'react';
import Onyx from 'react-native-onyx';
import {measurePerformance} from 'reassure';
import {measureRenders} from 'reassure';
import type {WithCurrentUserPersonalDetailsProps} from '@components/withCurrentUserPersonalDetails';
import type Navigation from '@libs/Navigation/Navigation';
import ComposeProviders from '@src/components/ComposeProviders';
Expand Down Expand Up @@ -123,7 +123,7 @@ test('[ReportActionsList] should render ReportActionsList with 500 reportActions
[ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtilsModule.fakePersonalDetails,
});

await measurePerformance(<ReportActionsListWrapper />, {scenario});
await measureRenders(<ReportActionsListWrapper />, {scenario});
});

test('[ReportActionsList] should render list items', async () => {
Expand All @@ -138,7 +138,7 @@ test('[ReportActionsList] should render list items', async () => {
[ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtilsModule.fakePersonalDetails,
});

await measurePerformance(<ReportActionsListWrapper />, {scenario});
await measureRenders(<ReportActionsListWrapper />, {scenario});
});

test('[ReportActionsList] should scroll through list of items', async () => {
Expand Down Expand Up @@ -170,5 +170,5 @@ test('[ReportActionsList] should scroll through list of items', async () => {
[ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtilsModule.fakePersonalDetails,
});

await measurePerformance(<ReportActionsListWrapper />, {scenario});
await measureRenders(<ReportActionsListWrapper />, {scenario});
});
8 changes: 4 additions & 4 deletions tests/perf-test/ReportScreen.perf-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type ReactNative from 'react-native';
import {Dimensions, InteractionManager} from 'react-native';
import Onyx from 'react-native-onyx';
import type Animated from 'react-native-reanimated';
import {measurePerformance} from 'reassure';
import {measureRenders} from 'reassure';
import type {WithNavigationFocusProps} from '@components/withNavigationFocus';
import type Navigation from '@libs/Navigation/Navigation';
import type {AuthScreensParamList} from '@libs/Navigation/types';
Expand Down Expand Up @@ -227,7 +227,7 @@ test('[ReportScreen] should render ReportScreen', async () => {
...reportCollectionDataSet,
...reportActionsCollectionDataSet,
});
await measurePerformance(
await measureRenders(
<ReportScreenWrapper
navigation={navigation}
route={mockRoute}
Expand Down Expand Up @@ -262,7 +262,7 @@ test('[ReportScreen] should render composer', async () => {
...reportCollectionDataSet,
...reportActionsCollectionDataSet,
});
await measurePerformance(
await measureRenders(
<ReportScreenWrapper
navigation={navigation}
route={mockRoute}
Expand Down Expand Up @@ -302,7 +302,7 @@ test('[ReportScreen] should render report list', async () => {
...reportCollectionDataSet,
...reportActionsCollectionDataSet,
});
await measurePerformance(
await measureRenders(
<ReportScreenWrapper
navigation={navigation}
route={mockRoute}
Expand Down
10 changes: 5 additions & 5 deletions tests/perf-test/SelectionList.perf-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {fireEvent} from '@testing-library/react-native';
import type {RenderResult} from '@testing-library/react-native';
import React, {useState} from 'react';
import type {ComponentType} from 'react';
import {measurePerformance} from 'reassure';
import {measureRenders} from 'reassure';
import SelectionList from '@components/SelectionList';
import RadioListItem from '@components/SelectionList/RadioListItem';
import type {ListItem} from '@components/SelectionList/types';
Expand Down Expand Up @@ -119,7 +119,7 @@ function SelectionListWrapper({canSelectMultiple}: SelectionListWrapperProps) {
}

test('[SelectionList] should render 1 section and a thousand items', () => {
measurePerformance(<SelectionListWrapper />);
measureRenders(<SelectionListWrapper />);
});

test('[SelectionList] should press a list item', () => {
Expand All @@ -128,7 +128,7 @@ test('[SelectionList] should press a list item', () => {
fireEvent.press(screen.getByText('Item 5'));
};

measurePerformance(<SelectionListWrapper />, {scenario});
measureRenders(<SelectionListWrapper />, {scenario});
});

test('[SelectionList] should render multiple selection and select 3 items', () => {
Expand All @@ -139,7 +139,7 @@ test('[SelectionList] should render multiple selection and select 3 items', () =
fireEvent.press(screen.getByText('Item 3'));
};

measurePerformance(<SelectionListWrapper canSelectMultiple />, {scenario});
measureRenders(<SelectionListWrapper canSelectMultiple />, {scenario});
});

test('[SelectionList] should scroll and select a few items', () => {
Expand Down Expand Up @@ -171,5 +171,5 @@ test('[SelectionList] should scroll and select a few items', () => {
fireEvent.press(screen.getByText('Item 15'));
};

measurePerformance(<SelectionListWrapper canSelectMultiple />, {scenario});
measureRenders(<SelectionListWrapper canSelectMultiple />, {scenario});
});
10 changes: 5 additions & 5 deletions tests/perf-test/SidebarLinks.perf-test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {fireEvent, screen} from '@testing-library/react-native';
import Onyx from 'react-native-onyx';
import {measurePerformance} from 'reassure';
import {measureRenders} from 'reassure';
import variables from '@styles/variables';
import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
Expand Down Expand Up @@ -82,7 +82,7 @@ describe('SidebarLinks', () => {
...mockedResponseMap,
});

await measurePerformance(<LHNTestUtils.MockedSidebarLinks />, {scenario, runs: 1});
await measureRenders(<LHNTestUtils.MockedSidebarLinks />, {scenario, runs: 1});
});

test('[SidebarLinks] should render list itmes', async () => {
Expand All @@ -104,7 +104,7 @@ describe('SidebarLinks', () => {
...mockedResponseMap,
});

await measurePerformance(<LHNTestUtils.MockedSidebarLinks />, {scenario});
await measureRenders(<LHNTestUtils.MockedSidebarLinks />, {scenario});
});

test('[SidebarLinks] should scroll through the list of items ', async () => {
Expand Down Expand Up @@ -142,7 +142,7 @@ describe('SidebarLinks', () => {
...mockedResponseMap,
});

await measurePerformance(<LHNTestUtils.MockedSidebarLinks />, {scenario});
await measureRenders(<LHNTestUtils.MockedSidebarLinks />, {scenario});
});

test('[SidebarLinks] should click on list item', async () => {
Expand All @@ -161,6 +161,6 @@ describe('SidebarLinks', () => {
...mockedResponseMap,
});

await measurePerformance(<LHNTestUtils.MockedSidebarLinks />, {scenario});
await measureRenders(<LHNTestUtils.MockedSidebarLinks />, {scenario});
});
});

0 comments on commit a5bc7a4

Please sign in to comment.