From ad7eb71753b494996865bbdb6330bb9cf0ebf392 Mon Sep 17 00:00:00 2001 From: Ionatan Wiznia Date: Fri, 31 May 2024 23:58:32 +0200 Subject: [PATCH] Revert "fix: Taxes - App allows deleted tax rate to be selected as currency default in offline mode." --- .../SelectionList/RadioListItem.tsx | 1 - src/components/TagPicker/index.tsx | 2 - src/libs/OptionsListUtils.ts | 30 ++-- tests/unit/OptionsListUtilsTest.ts | 138 +----------------- 4 files changed, 16 insertions(+), 155 deletions(-) diff --git a/src/components/SelectionList/RadioListItem.tsx b/src/components/SelectionList/RadioListItem.tsx index c7884690c067d..b595008e4e3bb 100644 --- a/src/components/SelectionList/RadioListItem.tsx +++ b/src/components/SelectionList/RadioListItem.tsx @@ -40,7 +40,6 @@ function RadioListItem({ keyForList={item.keyForList} onFocus={onFocus} shouldSyncFocus={shouldSyncFocus} - pendingAction={item.pendingAction} > <> diff --git a/src/components/TagPicker/index.tsx b/src/components/TagPicker/index.tsx index 40a0ac5e487f4..cbd9418a83e9f 100644 --- a/src/components/TagPicker/index.tsx +++ b/src/components/TagPicker/index.tsx @@ -11,14 +11,12 @@ import type * as ReportUtils from '@libs/ReportUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {PolicyTag, PolicyTagList, PolicyTags, RecentlyUsedTags} from '@src/types/onyx'; -import type {PendingAction} from '@src/types/onyx/OnyxCommon'; type SelectedTagOption = { name: string; enabled: boolean; isSelected?: boolean; accountID: number | undefined; - pendingAction?: PendingAction; }; type TagPickerOnyxProps = { diff --git a/src/libs/OptionsListUtils.ts b/src/libs/OptionsListUtils.ts index f321c10c686eb..ac5bc9a2527ba 100644 --- a/src/libs/OptionsListUtils.ts +++ b/src/libs/OptionsListUtils.ts @@ -78,7 +78,6 @@ type OptionTree = { tooltipText: string; isDisabled: boolean; isSelected: boolean; - pendingAction?: OnyxCommon.PendingAction; } & Option; type PayeePersonalDetails = { @@ -108,7 +107,6 @@ type TaxRatesOption = { isDisabled?: boolean; keyForList?: string; isSelected?: boolean; - pendingAction?: OnyxCommon.PendingAction; }; type TaxSection = { @@ -126,7 +124,6 @@ type Category = { name: string; enabled: boolean; isSelected?: boolean; - pendingAction?: OnyxCommon.PendingAction; }; type Tax = { @@ -953,7 +950,6 @@ function sortCategories(categories: Record): Category[] { lodashSet(hierarchy, path, { ...existedValue, name: category.name, - pendingAction: category.pendingAction, }); }); @@ -964,11 +960,10 @@ function sortCategories(categories: Record): Category[] { */ const flatHierarchy = (initialHierarchy: Hierarchy) => Object.values(initialHierarchy).reduce((acc: Category[], category) => { - const {name, pendingAction, ...subcategories} = category; + const {name, ...subcategories} = category; if (name) { const categoryObject: Category = { name, - pendingAction, enabled: categories[name]?.enabled ?? false, }; @@ -1018,9 +1013,8 @@ function getCategoryOptionTree(options: Record | Category[], i keyForList: option.name, searchText: option.name, tooltipText: option.name, - isDisabled: !option.enabled || option.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, + isDisabled: !option.enabled, isSelected: !!option.isSelected, - pendingAction: option.pendingAction, }); return; @@ -1040,9 +1034,8 @@ function getCategoryOptionTree(options: Record | Category[], i keyForList: searchText, searchText, tooltipText: optionName, - isDisabled: isChild ? !option.enabled || option.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE : true, + isDisabled: isChild ? !option.enabled : true, isSelected: isChild ? !!option.isSelected : selectedOptionsName.includes(searchText), - pendingAction: option.pendingAction, }); }); }); @@ -1142,10 +1135,7 @@ function getCategoryListSections( } const filteredRecentlyUsedCategories = recentlyUsedCategories - .filter( - (categoryName) => - !selectedOptionNames.includes(categoryName) && categories[categoryName]?.enabled && categories[categoryName]?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, - ) + .filter((categoryName) => !selectedOptionNames.includes(categoryName) && categories[categoryName]?.enabled) .map((categoryName) => ({ name: categoryName, enabled: categories[categoryName].enabled ?? false, @@ -1181,7 +1171,7 @@ function getCategoryListSections( * * @param tags - an initial tag array */ -function getTagsOptions(tags: Array>, selectedOptions?: SelectedTagOption[]): Option[] { +function getTagsOptions(tags: Array>, selectedOptions?: SelectedTagOption[]): Option[] { return tags.map((tag) => { // This is to remove unnecessary escaping backslash in tag name sent from backend. const cleanedName = PolicyUtils.getCleanedTagName(tag.name); @@ -1190,9 +1180,8 @@ function getTagsOptions(tags: Array selectedTag.name === tag.name), - pendingAction: tag.pendingAction, }; }); } @@ -1265,7 +1254,7 @@ function getTagListSections( const filteredRecentlyUsedTags = recentlyUsedTags .filter((recentlyUsedTag) => { const tagObject = tags.find((tag) => tag.name === recentlyUsedTag); - return !!tagObject?.enabled && !selectedOptionNames.includes(recentlyUsedTag) && tagObject?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; + return !!tagObject?.enabled && !selectedOptionNames.includes(recentlyUsedTag); }) .map((tag) => ({name: tag, enabled: true})); @@ -1395,15 +1384,14 @@ function sortTaxRates(taxRates: TaxRates): TaxRate[] { * Builds the options for taxRates */ function getTaxRatesOptions(taxRates: Array>): TaxRatesOption[] { - return taxRates.map(({code, modifiedName, isDisabled, isSelected, pendingAction}) => ({ + return taxRates.map(({code, modifiedName, isDisabled, isSelected}) => ({ code, text: modifiedName, keyForList: modifiedName, searchText: modifiedName, tooltipText: modifiedName, - isDisabled: !!isDisabled || pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE, + isDisabled, isSelected, - pendingAction, })); } diff --git a/tests/unit/OptionsListUtilsTest.ts b/tests/unit/OptionsListUtilsTest.ts index bcb569ba4490e..ae8a93efda96a 100644 --- a/tests/unit/OptionsListUtilsTest.ts +++ b/tests/unit/OptionsListUtilsTest.ts @@ -7,7 +7,6 @@ import * as OptionsListUtils from '@src/libs/OptionsListUtils'; import * as ReportUtils from '@src/libs/ReportUtils'; import ONYXKEYS from '@src/ONYXKEYS'; import type {PersonalDetails, Policy, PolicyCategories, Report, TaxRatesWithDefault, Transaction} from '@src/types/onyx'; -import type {PendingAction} from '@src/types/onyx/OnyxCommon'; import waitForBatchedUpdates from '../utils/waitForBatchedUpdates'; type PersonalDetailsList = Record; @@ -818,7 +817,6 @@ describe('OptionsListUtils', () => { 'GL Code': '', externalID: '', origin: '', - pendingAction: undefined, }, Restaurant: { enabled: true, @@ -828,7 +826,6 @@ describe('OptionsListUtils', () => { 'GL Code': '', externalID: '', origin: '', - pendingAction: 'delete', }, Food: { enabled: true, @@ -838,7 +835,6 @@ describe('OptionsListUtils', () => { 'GL Code': '', externalID: '', origin: '', - pendingAction: undefined, }, 'Food: Meat': { enabled: true, @@ -848,7 +844,6 @@ describe('OptionsListUtils', () => { 'GL Code': '', externalID: '', origin: '', - pendingAction: undefined, }, }; const smallResultList: OptionsListUtils.CategoryTreeSection[] = [ @@ -863,7 +858,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Food', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: ' Meat', @@ -872,16 +866,14 @@ describe('OptionsListUtils', () => { tooltipText: 'Meat', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Restaurant', keyForList: 'Restaurant', searchText: 'Restaurant', tooltipText: 'Restaurant', - isDisabled: true, + isDisabled: false, isSelected: false, - pendingAction: 'delete', }, ], indexOffset: 3, @@ -900,7 +892,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Food', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Food: Meat', @@ -909,7 +900,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Food: Meat', isDisabled: false, isSelected: false, - pendingAction: undefined, }, ], }, @@ -1063,7 +1053,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Medical', isDisabled: true, isSelected: true, - pendingAction: undefined, }, ], }, @@ -1079,7 +1068,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Restaurant', isDisabled: false, isSelected: false, - pendingAction: undefined, }, ], }, @@ -1095,7 +1083,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Cars', isDisabled: true, isSelected: false, - pendingAction: undefined, }, { text: ' Audi', @@ -1104,7 +1091,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Audi', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: ' Mercedes-Benz', @@ -1113,7 +1099,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Mercedes-Benz', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Food', @@ -1122,7 +1107,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Food', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: ' Meat', @@ -1131,7 +1115,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Meat', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: ' Milk', @@ -1140,7 +1123,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Milk', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Restaurant', @@ -1149,7 +1131,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Restaurant', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Travel', @@ -1158,7 +1139,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Travel', isDisabled: true, isSelected: false, - pendingAction: undefined, }, { text: ' Meals', @@ -1167,7 +1147,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Meals', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: ' Breakfast', @@ -1176,7 +1155,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Breakfast', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: ' Lunch', @@ -1185,7 +1163,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Lunch', isDisabled: false, isSelected: false, - pendingAction: undefined, }, ], }, @@ -1203,7 +1180,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Food', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Food: Meat', @@ -1212,7 +1188,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Food: Meat', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Food: Milk', @@ -1221,7 +1196,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Food: Milk', isDisabled: false, isSelected: false, - pendingAction: undefined, }, ], }, @@ -1248,7 +1222,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Medical', isDisabled: true, isSelected: true, - pendingAction: undefined, }, ], }, @@ -1343,7 +1316,6 @@ describe('OptionsListUtils', () => { enabled: true, name: 'HR', accountID: undefined, - pendingAction: 'delete', }, }; const smallResultList: OptionsListUtils.CategorySection[] = [ @@ -1359,16 +1331,14 @@ describe('OptionsListUtils', () => { tooltipText: 'Accounting', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'HR', keyForList: 'HR', searchText: 'HR', tooltipText: 'HR', - isDisabled: true, + isDisabled: false, isSelected: false, - pendingAction: 'delete', }, { text: 'Medical', @@ -1377,7 +1347,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Medical', isDisabled: false, isSelected: false, - pendingAction: undefined, }, ], }, @@ -1394,7 +1363,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Accounting', isDisabled: false, isSelected: false, - pendingAction: undefined, }, ], }, @@ -1456,7 +1424,6 @@ describe('OptionsListUtils', () => { enabled: true, name: 'Taxes', accountID: undefined, - pendingAction: 'delete', }, Benefits: { enabled: true, @@ -1476,7 +1443,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Medical', isDisabled: false, isSelected: true, - pendingAction: undefined, }, ], }, @@ -1491,7 +1457,6 @@ describe('OptionsListUtils', () => { tooltipText: 'HR', isDisabled: false, isSelected: false, - pendingAction: undefined, }, ], }, @@ -1507,7 +1472,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Accounting', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Benefits', @@ -1516,7 +1480,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Benefits', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Cleaning', @@ -1525,7 +1488,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Cleaning', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Food', @@ -1534,7 +1496,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Food', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'HR', @@ -1543,7 +1504,6 @@ describe('OptionsListUtils', () => { tooltipText: 'HR', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Software', @@ -1552,16 +1512,14 @@ describe('OptionsListUtils', () => { tooltipText: 'Software', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Taxes', keyForList: 'Taxes', searchText: 'Taxes', tooltipText: 'Taxes', - isDisabled: true, + isDisabled: false, isSelected: false, - pendingAction: 'delete', }, ], }, @@ -1578,7 +1536,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Accounting', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Cleaning', @@ -1587,7 +1544,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Cleaning', isDisabled: false, isSelected: false, - pendingAction: undefined, }, ], }, @@ -1749,7 +1705,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Meals', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Restaurant', @@ -1758,7 +1713,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Restaurant', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Food', @@ -1767,7 +1721,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Food', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: ' Meat', @@ -1776,7 +1729,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Meat', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: ' Milk', @@ -1785,7 +1737,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Milk', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Cars', @@ -1794,7 +1745,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Cars', isDisabled: true, isSelected: false, - pendingAction: undefined, }, { text: ' Audi', @@ -1803,7 +1753,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Audi', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: ' Mercedes-Benz', @@ -1812,7 +1761,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Mercedes-Benz', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Travel', @@ -1821,7 +1769,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Travel', isDisabled: true, isSelected: false, - pendingAction: undefined, }, { text: ' Meals', @@ -1830,7 +1777,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Meals', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: ' Breakfast', @@ -1839,7 +1785,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Breakfast', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: ' Lunch', @@ -1848,7 +1793,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Lunch', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Plain', @@ -1857,7 +1801,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Plain', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Audi', @@ -1866,7 +1809,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Audi', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Health', @@ -1875,7 +1817,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Health', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'A', @@ -1884,7 +1825,6 @@ describe('OptionsListUtils', () => { tooltipText: 'A', isDisabled: true, isSelected: false, - pendingAction: undefined, }, { text: ' B', @@ -1893,7 +1833,6 @@ describe('OptionsListUtils', () => { tooltipText: 'B', isDisabled: true, isSelected: false, - pendingAction: undefined, }, { text: ' C', @@ -1902,7 +1841,6 @@ describe('OptionsListUtils', () => { tooltipText: 'C', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: ' D', @@ -1911,7 +1849,6 @@ describe('OptionsListUtils', () => { tooltipText: 'D', isDisabled: true, isSelected: false, - pendingAction: undefined, }, { text: ' E', @@ -1920,7 +1857,6 @@ describe('OptionsListUtils', () => { tooltipText: 'E', isDisabled: false, isSelected: false, - pendingAction: undefined, }, ]; const resultOneLine = [ @@ -1931,7 +1867,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Meals', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Restaurant', @@ -1940,7 +1875,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Restaurant', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Food', @@ -1949,7 +1883,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Food', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Food: Meat', @@ -1958,7 +1891,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Food: Meat', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Food: Milk', @@ -1967,7 +1899,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Food: Milk', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Cars: Audi', @@ -1976,7 +1907,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Cars: Audi', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Cars: Mercedes-Benz', @@ -1985,7 +1915,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Cars: Mercedes-Benz', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Travel: Meals', @@ -1994,7 +1923,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Travel: Meals', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Travel: Meals: Breakfast', @@ -2003,7 +1931,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Travel: Meals: Breakfast', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Travel: Meals: Lunch', @@ -2012,7 +1939,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Travel: Meals: Lunch', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Plain', @@ -2021,7 +1947,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Plain', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Audi', @@ -2030,7 +1955,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Audi', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'Health', @@ -2039,7 +1963,6 @@ describe('OptionsListUtils', () => { tooltipText: 'Health', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'A: B: C', @@ -2048,7 +1971,6 @@ describe('OptionsListUtils', () => { tooltipText: 'A: B: C', isDisabled: false, isSelected: false, - pendingAction: undefined, }, { text: 'A: B: C: D: E', @@ -2057,7 +1979,6 @@ describe('OptionsListUtils', () => { tooltipText: 'A: B: C: D: E', isDisabled: false, isSelected: false, - pendingAction: undefined, }, ]; @@ -2086,7 +2007,6 @@ describe('OptionsListUtils', () => { Test: { name: 'Test', enabled: true, - pendingAction: 'delete' as PendingAction, }, Test1: { name: 'Test1', @@ -2141,87 +2061,70 @@ describe('OptionsListUtils', () => { { name: 'Taxes', enabled: true, - pendingAction: undefined, }, { name: 'Taxi', enabled: false, - pendingAction: undefined, }, { name: 'Test', enabled: true, - pendingAction: 'delete', }, { name: 'Test: Test1', enabled: true, - pendingAction: undefined, }, { name: 'Test: Test1: Subtest1', enabled: true, - pendingAction: undefined, }, { name: 'Test: Test1: Subtest2', enabled: true, - pendingAction: undefined, }, { name: 'Test: Test1: Subtest3', enabled: false, - pendingAction: undefined, }, { name: 'Test: Test1: Subtest4', enabled: true, - pendingAction: undefined, }, { name: 'Test: Test2', enabled: true, - pendingAction: undefined, }, { name: 'Test: Test3: Subtest1', enabled: true, - pendingAction: undefined, }, { name: 'Test1', enabled: true, - pendingAction: undefined, }, { name: 'Test1: Subtest1', enabled: true, - pendingAction: undefined, }, { name: 'Test1: Subtest2', enabled: true, - pendingAction: undefined, }, { name: 'Test1: Subtest3', enabled: true, - pendingAction: undefined, }, { name: 'Travel', enabled: true, - pendingAction: undefined, }, { name: 'Travel: Nested-Travel', enabled: true, - pendingAction: undefined, }, { name: 'Utilities', enabled: true, - pendingAction: undefined, }, ]; const categoriesIncorrectOrdering2 = { @@ -2286,72 +2189,58 @@ describe('OptionsListUtils', () => { { enabled: true, name: 'Cars: Audi', - pendingAction: undefined, }, { enabled: false, name: 'Cars: BMW', - pendingAction: undefined, }, { enabled: true, name: 'Cars: Mercedes-Benz', - pendingAction: undefined, }, { enabled: true, name: 'Food', - pendingAction: undefined, }, { enabled: true, name: 'Food: Meat', - pendingAction: undefined, }, { enabled: true, name: 'Food: Milk', - pendingAction: undefined, }, { enabled: false, name: 'Food: Vegetables', - pendingAction: undefined, }, { enabled: false, name: 'Medical', - pendingAction: undefined, }, { enabled: true, name: 'Restaurant', - pendingAction: undefined, }, { enabled: false, name: 'Taxi', - pendingAction: undefined, }, { enabled: true, name: 'Travel: Meals', - pendingAction: undefined, }, { enabled: true, name: 'Travel: Meals: Breakfast', - pendingAction: undefined, }, { enabled: false, name: 'Travel: Meals: Dinner', - pendingAction: undefined, }, { enabled: true, name: 'Travel: Meals: Lunch', - pendingAction: undefined, }, ]; const categoriesIncorrectOrdering3 = { @@ -2384,32 +2273,26 @@ describe('OptionsListUtils', () => { { enabled: true, name: 'Dr. House', - pendingAction: undefined, }, { enabled: true, name: 'House, M.D.', - pendingAction: undefined, }, { enabled: true, name: 'Many.dots.on.the.way.', - pendingAction: undefined, }, { enabled: false, name: 'More.Many.dots.on.the.way.', - pendingAction: undefined, }, { enabled: true, name: 'Movies', - pendingAction: undefined, }, { enabled: true, name: 'Movies: Mr. Nobody', - pendingAction: undefined, }, ]; @@ -2658,21 +2541,18 @@ describe('OptionsListUtils', () => { value: '3%', code: 'CODE2', modifiedName: 'Tax rate 2 (3%)', - pendingAction: 'delete', }, CODE3: { name: 'Tax option 3', value: '5%', code: 'CODE3', modifiedName: 'Tax option 3 (5%)', - pendingAction: undefined, }, CODE1: { name: 'Tax exempt 1', value: '0%', code: 'CODE1', modifiedName: 'Tax exempt 1 (0%) • Default', - pendingAction: undefined, }, }, }; @@ -2689,33 +2569,30 @@ describe('OptionsListUtils', () => { data: [ { code: 'CODE1', - isDisabled: false, + isDisabled: undefined, isSelected: undefined, keyForList: 'Tax exempt 1 (0%) • Default', searchText: 'Tax exempt 1 (0%) • Default', text: 'Tax exempt 1 (0%) • Default', tooltipText: 'Tax exempt 1 (0%) • Default', - pendingAction: undefined, }, { code: 'CODE3', - isDisabled: false, + isDisabled: undefined, isSelected: undefined, keyForList: 'Tax option 3 (5%)', searchText: 'Tax option 3 (5%)', text: 'Tax option 3 (5%)', tooltipText: 'Tax option 3 (5%)', - pendingAction: undefined, }, { code: 'CODE2', - isDisabled: true, + isDisabled: undefined, isSelected: undefined, keyForList: 'Tax rate 2 (3%)', searchText: 'Tax rate 2 (3%)', text: 'Tax rate 2 (3%)', tooltipText: 'Tax rate 2 (3%)', - pendingAction: 'delete', }, ], shouldShow: false, @@ -2728,13 +2605,12 @@ describe('OptionsListUtils', () => { data: [ { code: 'CODE2', - isDisabled: true, + isDisabled: undefined, isSelected: undefined, keyForList: 'Tax rate 2 (3%)', searchText: 'Tax rate 2 (3%)', text: 'Tax rate 2 (3%)', tooltipText: 'Tax rate 2 (3%)', - pendingAction: 'delete', }, ], shouldShow: true,