Skip to content

Commit

Permalink
remove unintended code
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Apr 23, 2024
1 parent 2e21c24 commit 6462567
Showing 1 changed file with 0 additions and 126 deletions.
126 changes: 0 additions & 126 deletions tests/unit/OptionsListUtilsTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2617,132 +2617,6 @@ describe('OptionsListUtils', () => {
expect(wrongSearchResult.taxRatesOptions).toStrictEqual(wrongSearchResultList);
});

it('getFilteredOptions() for taxRate', () => {
const search = 'rate';
const emptySearch = '';
const wrongSearch = 'bla bla';

const taxRatesWithDefault: TaxRatesWithDefault = {
name: 'Tax',
defaultExternalID: 'CODE1',
defaultValue: '0%',
foreignTaxDefault: 'CODE1',
taxes: {
CODE2: {
name: 'Tax rate 2',
value: '3%',
code: 'CODE2',
modifiedName: 'Tax rate 2 (3%)',
},
CODE3: {
name: 'Tax option 3',
value: '5%',
code: 'CODE3',
modifiedName: 'Tax option 3 (5%)',
},
CODE1: {
name: 'Tax exempt 1',
value: '0%',
code: 'CODE1',
modifiedName: 'Tax exempt 1 (0%) • Default',
},
},
};

const resultList: OptionsListUtils.CategorySection[] = [
{
title: '',
shouldShow: false,
// data sorted alphabetically by name
data: [
{
// Adds 'Default' title to default tax.
// Adds value to tax name for more description.
text: 'Tax exempt 1 (0%) • Default',
keyForList: 'Tax exempt 1 (0%) • Default',
searchText: 'Tax exempt 1 (0%) • Default',
tooltipText: 'Tax exempt 1 (0%) • Default',
isDisabled: undefined,
// creates a data option.
data: {
name: 'Tax exempt 1',
code: 'CODE1',
modifiedName: 'Tax exempt 1 (0%) • Default',
value: '0%',
},
},
{
text: 'Tax option 3 (5%)',
keyForList: 'Tax option 3 (5%)',
searchText: 'Tax option 3 (5%)',
tooltipText: 'Tax option 3 (5%)',
isDisabled: undefined,
data: {
name: 'Tax option 3',
code: 'CODE3',
modifiedName: 'Tax option 3 (5%)',
value: '5%',
},
},
{
text: 'Tax rate 2 (3%)',
keyForList: 'Tax rate 2 (3%)',
searchText: 'Tax rate 2 (3%)',
tooltipText: 'Tax rate 2 (3%)',
isDisabled: undefined,
data: {
name: 'Tax rate 2',
code: 'CODE2',
modifiedName: 'Tax rate 2 (3%)',
value: '3%',
},
},
],
},
];

const searchResultList: OptionsListUtils.CategorySection[] = [
{
title: '',
shouldShow: true,
// data sorted alphabetically by name
data: [
{
text: 'Tax rate 2 (3%)',
keyForList: 'Tax rate 2 (3%)',
searchText: 'Tax rate 2 (3%)',
tooltipText: 'Tax rate 2 (3%)',
isDisabled: undefined,
data: {
name: 'Tax rate 2',
code: 'CODE2',
modifiedName: 'Tax rate 2 (3%)',
value: '3%',
},
},
],
},
];

const wrongSearchResultList: OptionsListUtils.CategorySection[] = [
{
title: '',
shouldShow: true,
data: [],
},
];

const result = OptionsListUtils.getFilteredOptions([], [], [], emptySearch, [], [], false, false, false, {}, [], false, {}, [], false, false, true, taxRatesWithDefault);

expect(result.taxRatesOptions).toStrictEqual(resultList);

const searchResult = OptionsListUtils.getFilteredOptions([], [], [], search, [], [], false, false, false, {}, [], false, {}, [], false, false, true, taxRatesWithDefault);
expect(searchResult.taxRatesOptions).toStrictEqual(searchResultList);

const wrongSearchResult = OptionsListUtils.getFilteredOptions([], [], [], wrongSearch, [], [], false, false, false, {}, [], false, {}, [], false, false, true, taxRatesWithDefault);
expect(wrongSearchResult.taxRatesOptions).toStrictEqual(wrongSearchResultList);
});

it('formatMemberForList()', () => {
const formattedMembers = Object.values(PERSONAL_DETAILS).map((personalDetail) => OptionsListUtils.formatMemberForList(personalDetail));

Expand Down

0 comments on commit 6462567

Please sign in to comment.