Skip to content

Commit 1695bbd

Browse files
committed
fix: treat colon-only return ranges as no filter
1 parent dd02b87 commit 1695bbd

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎scripts/update-data.test.ts‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import {
1818
parseProductPageSummary,
1919
parseRange,
2020
priceReturns,
21+
parseRanges,
22+
hasConfiguredFilters,
23+
readConfig,
2124
toIsoDate,
2225
} from './update-data';
2326

@@ -371,3 +374,16 @@ headerTest('header markup supplies a focusable counter and hidden rich panel wit
371374
headerExpect(html).toContain("trigger.addEventListener('focus', show)");
372375
headerExpect(html).toContain("trigger.addEventListener('pointerenter'");
373376
});
377+
378+
379+
describe('configured filter semantics', () => {
380+
test('colon range defaults mean no filter and partial batches retain the full universe', () => {
381+
const config = readConfig({
382+
AUM: ':', TER: ':', DIVIDEND_YIELD: ':', TICKERS: '',
383+
PERFORMANCE_YTD: ':', PERFORMANCE_1Y: ':', PERFORMANCE_3Y: ':', PERFORMANCE_5Y: ':', PERFORMANCE_10Y: ':',
384+
TOTAL_RETURN_YTD: ':', TOTAL_RETURN_1Y: ':', TOTAL_RETURN_3Y: ':', TOTAL_RETURN_5Y: ':', TOTAL_RETURN_10Y: ':',
385+
});
386+
expect(parseRanges({ PERFORMANCE_YTD: ':', PERFORMANCE_1Y: ':' }, 'PERFORMANCE')).toEqual({});
387+
expect(hasConfiguredFilters(config)).toBe(false);
388+
});
389+
});

0 commit comments

Comments
 (0)