Skip to content
Open
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: 2 additions & 1 deletion app/src/libs/buildParameterTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export function buildParameterTree(parameters: Record<string, any>): ParameterTr
(param: any) =>
(param.economy || param.household) &&
!param.parameter.includes('taxsim') &&
!param.parameter.includes('gov.abolitions')
!param.parameter.includes('gov.abolitions') &&
!param.parameter.includes('pycache')
)) {
const nodeToInsert: ParameterTreeNode = {
name: parameter.parameter,
Expand Down
9 changes: 9 additions & 0 deletions app/src/tests/fixtures/libs/buildParameterTreeMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,15 @@ export const mockFilteredParameters = {
type: 'parameter' as const,
indexInModule: 2,
},
'gov.contrib.pycache': {
parameter: 'gov.contrib.pycache',
label: 'Pycache',
description: 'Should be filtered out',
economy: true,
household: true,
type: 'parameter' as const,
indexInModule: 3,
},
};

// Mock parameters with neither economy nor household flags
Expand Down
7 changes: 5 additions & 2 deletions app/src/tests/unit/libs/buildParameterTree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe('buildParameterTree', () => {
expect(rate1Node?.label).toBe(EXPECTED_BRACKET_2_LABEL);
});

test('given parameters with taxsim or abolitions then filters them out', () => {
test('given parameters with taxsim, abolitions, or pycache then filters them out', () => {
// Given
const parameters = mockFilteredParameters;

Expand All @@ -162,12 +162,15 @@ describe('buildParameterTree', () => {
expect(taxNode).toBeDefined();
expectNodeToHaveChildren(taxNode, EXPECTED_ONE_CHILD);

// Should not have taxsim or abolitions nodes
// Should not have taxsim, abolitions, or pycache nodes
const taxsimNode = findNodeByName(tree, GOV_TAXSIM_NODE_NAME);
expect(taxsimNode).toBeUndefined();

const abolitionsNode = findNodeByName(tree, GOV_ABOLITIONS_NODE_NAME);
expect(abolitionsNode).toBeUndefined();

const pycacheNode = findNodeByName(tree, 'gov.contrib.pycache');
expect(pycacheNode).toBeUndefined();
});

test('given parameters without economy or household flags then excludes them', () => {
Expand Down
Loading