Skip to content

Commit

Permalink
cr fix
Browse files Browse the repository at this point in the history
  • Loading branch information
OlimpiaZurek committed Nov 22, 2023
1 parent 27d14d3 commit 060a46c
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
7 changes: 7 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2901,6 +2901,13 @@ const CONST = {
},

BACK_BUTTON_NATIVE_ID: 'backButton',

/**
* Performance test setup - run the same test multiple times to get a more accurate result
*/
PERFORMANCE_TESTS: {
RUNS: 20,
},
} as const;

export default CONST;
3 changes: 2 additions & 1 deletion tests/perf-test/ReportActionCompose.perf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {LocaleContextProvider} from '../../src/components/LocaleContextProvider'
import OnyxProvider from '../../src/components/OnyxProvider';
import {KeyboardStateProvider} from '../../src/components/withKeyboardState';
import {WindowDimensionsProvider} from '../../src/components/withWindowDimensions';
import CONST from '../../src/CONST';
import * as Localize from '../../src/libs/Localize';
import ONYXKEYS from '../../src/ONYXKEYS';
import ReportActionCompose from '../../src/pages/home/report/ReportActionCompose/ReportActionCompose';
Expand Down Expand Up @@ -67,7 +68,7 @@ beforeEach(() => {
Onyx.merge(ONYXKEYS.NETWORK, {isOffline: false});
});

const runs = 20;
const runs = CONST.PERFORMANCE_TESTS.RUNS;

function ReportActionComposeWrapper() {
return (
Expand Down
4 changes: 3 additions & 1 deletion tests/perf-test/ReportActionsList.perf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import ComposeProviders from '../../src/components/ComposeProviders';
import {LocaleContextProvider} from '../../src/components/LocaleContextProvider';
import OnyxProvider from '../../src/components/OnyxProvider';
import {WindowDimensionsProvider} from '../../src/components/withWindowDimensions';
import CONST from '../../src/CONST';
import * as Localize from '../../src/libs/Localize';
import ONYXKEYS from '../../src/ONYXKEYS';
import ReportActionsList from '../../src/pages/home/report/ReportActionsList';
Expand Down Expand Up @@ -96,7 +97,8 @@ function ReportActionsListWrapper() {
);
}

const runs = 20;
const runs = CONST.PERFORMANCE_TESTS.RUNS;

test('should render ReportActionsList with 500 reportActions stored', () => {
const scenario = async () => {
await screen.findByTestId('report-actions-list');
Expand Down
2 changes: 1 addition & 1 deletion tests/perf-test/ReportScreen.perf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function ReportScreenWrapper(args) {
);
}

const runs = 20;
const runs = CONST.PERFORMANCE_TESTS.RUNS;

test.skip('should render ReportScreen with composer interactions', () => {
const scenario = async () => {
Expand Down
3 changes: 2 additions & 1 deletion tests/perf-test/SelectionList.perf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, {useState} from 'react';
import {measurePerformance} from 'reassure';
import _ from 'underscore';
import SelectionList from '../../src/components/SelectionList';
import CONST from '../../src/CONST';
import variables from '../../src/styles/variables';

jest.mock('../../src/components/Icon/Expensicons');
Expand Down Expand Up @@ -92,7 +93,7 @@ function SelectionListWrapper(args) {
);
}

const runs = 20;
const runs = CONST.PERFORMANCE_TESTS.RUNS;

test('should render 1 section and a thousand items', () => {
measurePerformance(<SelectionListWrapper />);
Expand Down
2 changes: 1 addition & 1 deletion tests/perf-test/SidebarLinks.perf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const getMockedReportsMap = (length = 100) => {

const mockedResponseMap = getMockedReportsMap(500);

const runs = 20;
const runs = CONST.PERFORMANCE_TESTS.RUNS;

test('should render Sidebar with 500 reports stored', () => {
const scenario = async () => {
Expand Down

0 comments on commit 060a46c

Please sign in to comment.