Skip to content

Commit debec00

Browse files
Fix: remove unused date variable and obsolete tooltip-dismissal test
- Remove unused `date` variable in IOU/index.ts (ESLint no-unused-vars error) after SCAN_TEST_TOOLTIP dismissal logic was removed - Remove test case 'should exclude Manager McTest from results if user dismissed the tooltip' since the dismissed-tooltip check was removed from getRestrictedLogins as part of the SCAN_TEST_TOOLTIP removal Co-authored-by: Chavda Sachin <ChavdaSachin@users.noreply.github.com>
1 parent aaf6110 commit debec00

2 files changed

Lines changed: 0 additions & 36 deletions

File tree

src/libs/actions/IOU/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,6 @@ function buildOnyxDataForMoneyRequest(moneyRequestParams: BuildOnyxDataForMoneyR
14091409
let iouAction = iou.action;
14101410
let iouReport = iou.report;
14111411
if (isMoneyRequestToManagerMcTest) {
1412-
const date = new Date();
14131412
const isTestReceipt = transaction.receipt?.isTestReceipt ?? false;
14141413
const managerMcTestParticipant = getManagerMcTestParticipant(currentUserAccountIDParam, personalDetails) ?? {};
14151414
const optimisticIOUReportAction = buildOptimisticIOUReportAction({

tests/unit/OptionsListUtilsTest.tsx

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,41 +1307,6 @@ describe('OptionsListUtils', () => {
13071307
expect(result.personalDetails).not.toEqual(expect.arrayContaining([expect.objectContaining({login: CONST.EMAIL.MANAGER_MCTEST})]));
13081308
});
13091309

1310-
it('should exclude Manager McTest from results if user dismissed the tooltip', () => {
1311-
return waitForBatchedUpdates()
1312-
.then(() =>
1313-
// Given that the user has dismissed the tooltip
1314-
Onyx.set(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING, {
1315-
[CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_DRIVE_CONFIRMATION]: {
1316-
timestamp: DateUtils.getDBTime(new Date().valueOf()),
1317-
},
1318-
}),
1319-
)
1320-
.then(() => {
1321-
// When we call getValidOptions()
1322-
const optionsWhenUserAlreadySubmittedExpense = getValidOptions(
1323-
{reports: OPTIONS_WITH_MANAGER_MCTEST.reports, personalDetails: OPTIONS_WITH_MANAGER_MCTEST.personalDetails},
1324-
allPolicies,
1325-
{},
1326-
loginList,
1327-
CURRENT_USER_ACCOUNT_ID,
1328-
CURRENT_USER_EMAIL,
1329-
undefined,
1330-
{
1331-
includeP2P: true,
1332-
canShowManagerMcTest: true,
1333-
betas: [CONST.BETAS.NEWDOT_MANAGER_MCTEST],
1334-
sortedActions: undefined,
1335-
},
1336-
);
1337-
1338-
// Then the result should include all personalDetails except the currently logged in user and Manager McTest
1339-
expect(optionsWhenUserAlreadySubmittedExpense.personalDetails.length).toBe(Object.values(OPTIONS_WITH_MANAGER_MCTEST.personalDetails).length - 2);
1340-
// Then the result should not include Manager McTest
1341-
expect(optionsWhenUserAlreadySubmittedExpense.personalDetails).not.toEqual(expect.arrayContaining([expect.objectContaining({login: CONST.EMAIL.MANAGER_MCTEST})]));
1342-
});
1343-
});
1344-
13451310
it('should keep admin rooms if specified', () => {
13461311
// Given an admin room report search option
13471312
const adminRoom: SearchOption<Report> = {

0 commit comments

Comments
 (0)