Skip to content

Commit 7b6b2cb

Browse files
authored
Merge pull request Expensify#82807 from software-mansion-labs/home-page/fix-pagination-test
[NoQA][Home page][Follow up] Fix opens a chat and load newer messages Pagination test
2 parents f61f304 + 60abad5 commit 7b6b2cb

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

tests/ui/PaginationTest.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable @typescript-eslint/naming-convention */
22
import * as NativeNavigation from '@react-navigation/native';
3-
import {act, fireEvent, render, screen, waitFor, within} from '@testing-library/react-native';
3+
import {act, cleanup, fireEvent, render, screen, waitFor, within} from '@testing-library/react-native';
44
import {addSeconds, format, subMinutes} from 'date-fns';
55
import React from 'react';
66
import Onyx from 'react-native-onyx';
@@ -286,6 +286,7 @@ async function signInAndGetApp(): Promise<void> {
286286
describe('Pagination', () => {
287287
afterEach(async () => {
288288
await waitForIdle();
289+
cleanup();
289290
await act(async () => {
290291
await Onyx.clear();
291292

@@ -298,9 +299,7 @@ describe('Pagination', () => {
298299
jest.clearAllMocks();
299300
});
300301

301-
// @TODO: Adjust this test to work with the home page as a default screen.
302-
// GitHub issue: https://github.com/Expensify/App/issues/80982
303-
xit('opens a chat and load initial messages', async () => {
302+
it('opens a chat and load initial messages', async () => {
304303
mockOpenReport(5, '5');
305304

306305
await signInAndGetApp();
@@ -323,9 +322,7 @@ describe('Pagination', () => {
323322
TestHelper.expectAPICommandToHaveBeenCalled('GetNewerActions', 0);
324323
});
325324

326-
// @TODO: Adjust this test to work with the home page as a default screen.
327-
// GitHub issue: https://github.com/Expensify/App/issues/80982
328-
xit('opens a chat and load older messages', async () => {
325+
it('opens a chat and load older messages', async () => {
329326
mockOpenReport(CONST.REPORT.MIN_INITIAL_REPORT_ACTION_COUNT, '18');
330327
mockGetOlderActions(5);
331328

@@ -357,9 +354,7 @@ describe('Pagination', () => {
357354
});
358355
});
359356

360-
// @TODO: Adjust this test to work with the home page as a default screen.
361-
// GitHub issue: https://github.com/Expensify/App/issues/80982
362-
xit('opens a chat and load newer messages', async () => {
357+
it('opens a chat and load newer messages', async () => {
363358
mockOpenReport(5, '5');
364359
mockGetNewerActions(5);
365360

0 commit comments

Comments
 (0)