Skip to content

Commit

Permalink
Showing 4 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions __mocks__/@react-navigation/native/index.ts
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@ const useLinkTo = isJestEnv ? realReactNavigation.useLinkTo : () => null;
const useScrollToTop = isJestEnv ? realReactNavigation.useScrollToTop : () => null;
const useRoute = isJestEnv ? jest.fn() : () => ({params: {}});
const useFocusEffect = isJestEnv ? realReactNavigation.useFocusEffect : (callback: () => void) => callback();
// eslint-disable-next-line @typescript-eslint/naming-convention
const UNSTABLE_usePreventRemove = isJestEnv ? jest.fn() : () => {};

export {
1 change: 0 additions & 1 deletion src/components/SelectionList/BaseSelectionList.tsx
Original file line number Diff line number Diff line change
@@ -386,7 +386,6 @@ function BaseSelectionList<TItem extends ListItem>(
[
canSelectMultiple,
sections.length,
flattenedSections.selectedOptions.length,
scrollToIndex,
shouldShowTextInput,
clearInputAfterSelect,
10 changes: 2 additions & 8 deletions tests/ui/NewChatPageTest.tsx
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import {translateLocal} from '@libs/Localize';
import NewChatPage from '@pages/NewChatPage';
import ONYXKEYS from '@src/ONYXKEYS';
import type {NativeNavigationMock} from '../../__mocks__/@react-navigation/native';
import createPersonalDetails from '../utils/collections/personalDetails';
import {fakePersonalDetails} from '../utils/LHNTestUtils';
import waitForBatchedUpdatesWithAct from '../utils/waitForBatchedUpdatesWithAct';

jest.mock('@react-navigation/native');
@@ -24,13 +24,7 @@ describe('NewChatPage', () => {
});

it('should scroll to top when adding a user to the group selection', async () => {
await Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, {
1: createPersonalDetails(1),
2: createPersonalDetails(2),
3: createPersonalDetails(3),
4: createPersonalDetails(4),
5: createPersonalDetails(5),
});
await Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, fakePersonalDetails);
render(
<OnyxProvider>
<LocaleContextProvider>
2 changes: 1 addition & 1 deletion tests/unit/BaseSelectionListTest.tsx
Original file line number Diff line number Diff line change
@@ -64,7 +64,7 @@ describe('BaseSelectionList', () => {
expect(screen.getByTestId(`${CONST.BASE_LIST_ITEM_TEST_ID}2`)).toBeSelected();
});

it('should scroll to top when selecting a multi option list', async () => {
it('should scroll to top when selecting a multi option list', () => {
const spy = jest.spyOn(SectionList.prototype, 'scrollToLocation');
render(
<BaseListItemRenderer

0 comments on commit a984e7f

Please sign in to comment.