Skip to content

Commit

Permalink
Update Perf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mountiny committed May 29, 2024
1 parent f638048 commit 1bb10a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ const CONST = {
REIMBURSEMENT_DEQUEUED: 'REIMBURSEMENTDEQUEUED',
REIMBURSEMENT_REQUESTED: 'REIMBURSEMENTREQUESTED', // OldDot Action
REIMBURSEMENT_SETUP: 'REIMBURSEMENTSETUP', // OldDot Action
REIMBURSEMENT_SETUP_REQUESTED: 'REIMBURSEMENTSETUPREQUESTED', // OldDot Action
RENAMED: 'RENAMED',
REPORT_PREVIEW: 'REPORTPREVIEW',
SELECTED_FOR_RANDOM_AUDIT: 'SELECTEDFORRANDOMAUDIT', // OldDot Action
Expand Down
6 changes: 6 additions & 0 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,12 @@ function isReportActionDeprecated(reportAction: OnyxEntry<ReportAction>, key: st
return true;
}

const deprecatedOldDotReportActions = ['DELETEDACCOUNT', 'REIMBURSEMENTREQUESTED', 'REIMBURSEMENTSETUPREQUESTED', 'DONATION'];
if (deprecatedOldDotReportActions.includes(String(reportAction.actionName))) {
Log.info('Front end filtered out reportAction for being an older, deprecated report action', false, reportAction);
return true;
}

return false;
}

Expand Down
4 changes: 3 additions & 1 deletion tests/utils/collections/reportActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ const getRandomDate = (): string => {
return formattedDate;
};

const deprecatedReportActions: ActionName[] = [CONST.REPORT.ACTIONS.TYPE.DELETED_ACCOUNT, CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_REQUESTED, CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_SETUP_REQUESTED, CONST.REPORT.ACTIONS.TYPE.DONATION];

export default function createRandomReportAction(index: number): ReportAction {
return {
// we need to add any here because of the way we are generating random values
// eslint-disable-next-line @typescript-eslint/no-explicit-any
actionName: rand(flattenActionNamesValues(CONST.REPORT.ACTIONS.TYPE)) as any,
actionName: rand(flattenActionNamesValues(CONST.REPORT.ACTIONS.TYPE).filter((actionType: ActionName) => !deprecatedReportActions.includes(actionType))) as any,
reportActionID: index.toString(),
previousReportActionID: (index === 0 ? 0 : index - 1).toString(),
actorAccountID: index,
Expand Down

0 comments on commit 1bb10a5

Please sign in to comment.