Skip to content

Commit

Permalink
post merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
OlimpiaZurek committed Jan 24, 2024
1 parent eb00ffe commit 8d54f46
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
16 changes: 16 additions & 0 deletions tests/perf-test/ReportActionCompose.perf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,22 @@ jest.mock('../../src/libs/actions/EmojiPickerAction', () => {
};
});

jest.mock('../../src/components/withNavigationFocus', () => (Component) => {
function WithNavigationFocus(props) {
return (
<Component
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
isFocused={false}
/>
);
}

WithNavigationFocus.displayName = 'WithNavigationFocus';

return WithNavigationFocus;
});

beforeAll(() =>
Onyx.init({
keys: ONYXKEYS,
Expand Down
26 changes: 20 additions & 6 deletions tests/perf-test/SearchPage.perf-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,22 @@ jest.mock('@react-navigation/native', () => {
};
});

jest.mock('../../src/components/withNavigationFocus', () => (Component) => {
function WithNavigationFocus(props) {
return (
<Component
// eslint-disable-next-line react/jsx-props-no-spreading
{...props}
isFocused={false}
/>
);
}

WithNavigationFocus.displayName = 'WithNavigationFocus';

return WithNavigationFocus;
});

const getMockedReports = (length = 100) =>
createCollection(
(item) => `${ONYXKEYS.COLLECTION.REPORT}${item.reportID}`,
Expand Down Expand Up @@ -91,8 +107,6 @@ function SearchPageWrapper(args) {
);
}

const runs = CONST.PERFORMANCE_TESTS.RUNS;

test('[Search Page] should interact when text input changes', async () => {
const {addListener} = TestHelper.createAddListenerMock();

Expand All @@ -117,7 +131,7 @@ test('[Search Page] should interact when text input changes', async () => {
[ONYXKEYS.IS_SEARCHING_FOR_REPORTS]: true,
}),
)
.then(() => measurePerformance(<SearchPageWrapper navigation={navigation} />, {scenario, runs}));
.then(() => measurePerformance(<SearchPageWrapper navigation={navigation} />, {scenario}));
});

test('[Search Page] should render options list', async () => {
Expand All @@ -143,7 +157,7 @@ test('[Search Page] should render options list', async () => {
[ONYXKEYS.IS_SEARCHING_FOR_REPORTS]: true,
}),
)
.then(() => measurePerformance(<SearchPageWrapper navigation={navigation} />, {scenario, runs}));
.then(() => measurePerformance(<SearchPageWrapper navigation={navigation} />, {scenario}));
});

test.skip('[Search Page] should search in options list', async () => {
Expand Down Expand Up @@ -174,7 +188,7 @@ test.skip('[Search Page] should search in options list', async () => {
[ONYXKEYS.IS_SEARCHING_FOR_REPORTS]: true,
}),
)
.then(() => measurePerformance(<SearchPageWrapper navigation={navigation} />, {scenario, runs}));
.then(() => measurePerformance(<SearchPageWrapper navigation={navigation} />, {scenario}));
});

test.skip('[Search Page] should click on list item', async () => {
Expand Down Expand Up @@ -202,5 +216,5 @@ test.skip('[Search Page] should click on list item', async () => {
[ONYXKEYS.IS_SEARCHING_FOR_REPORTS]: true,
}),
)
.then(() => measurePerformance(<SearchPageWrapper navigation={navigation} />, {scenario, runs}));
.then(() => measurePerformance(<SearchPageWrapper navigation={navigation} />, {scenario}));
});

0 comments on commit 8d54f46

Please sign in to comment.