Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/unit/BaseSelectionListSectionsTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ jest.mock('@react-navigation/native', () => {
...actualNav,
useIsFocused: jest.fn(),
useFocusEffect: jest.fn(),
useNavigation: jest.fn(() => ({
isFocused: jest.fn(() => true),
})),
};
});

Expand Down
15 changes: 12 additions & 3 deletions tests/unit/OptionsListUtilsTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,10 @@ describe('OptionsListUtils', () => {
// Given a report without reportID (so it uses the lastReportAction)
const report: Report | undefined = undefined;
const lastActorDetails = PERSONAL_DETAILS['3'];
const lastAction = createRandomReportAction(1);
const lastAction = {
...createRandomReportAction(1),
actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT,
};

// When we call shouldShowLastActorDisplayName with all valid conditions
const result = shouldShowLastActorDisplayName(report, lastActorDetails, lastAction);
Expand All @@ -1406,7 +1409,10 @@ describe('OptionsListUtils', () => {
// Given a report without reportID (so it uses the lastReportAction)
const report: Report | undefined = undefined;
const lastActorDetails = PERSONAL_DETAILS['2'];
const lastAction = createRandomReportAction(1);
const lastAction = {
...createRandomReportAction(1),
actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT,
};

const result = shouldShowLastActorDisplayName(report, lastActorDetails, lastAction);
expect(result).toBe(true);
Expand All @@ -1417,7 +1423,10 @@ describe('OptionsListUtils', () => {
// Given a report without reportID
const report: Report | undefined = undefined;
const lastActorDetails = PERSONAL_DETAILS['2'];
const lastAction = createRandomReportAction(1);
const lastAction = {
...createRandomReportAction(1),
actionName: CONST.REPORT.ACTIONS.TYPE.ADD_COMMENT,
};

// When we call shouldShowLastActorDisplayName with the current user as last actor
const result = shouldShowLastActorDisplayName(report, lastActorDetails, lastAction);
Expand Down
Loading