Clear M1 milestone bugs (T-37, T-39, T-41, T-42, T-44, T-45, T-46, T-48, T-49, T-51, T-52)
This commit is contained in:
parent
199f7beecd
commit
9e259ca43b
18 changed files with 255 additions and 34 deletions
|
|
@ -230,10 +230,27 @@ describe('pipeline builder edge cases', () => {
|
|||
expect(
|
||||
(buildQmBarSpansPipeline()[2] as { $group: Record<string, unknown> }).$group.barCount
|
||||
).toEqual({
|
||||
$sum: 1,
|
||||
$sum: {
|
||||
$cond: [{ $ne: ['$normalizedDate', null] }, 1, 0],
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
test('stored source IDs with leading/trailing spaces are not merged with trimmed IDs', async () => {
|
||||
const reader: BarSpanAggregateReader = {
|
||||
aggregate<T extends Record<string, unknown>>(): T[] {
|
||||
return [
|
||||
{ _id: 'AAPL.US', firstBarDate: '2020-01-02', lastBarDate: '2024-12-31', barCount: 10 },
|
||||
{ _id: ' AAPL.US ', firstBarDate: '2021-01-04', lastBarDate: '2022-12-30', barCount: 5 },
|
||||
] as unknown as T[];
|
||||
},
|
||||
};
|
||||
const result = await computeBarSpans(reader, { sources: ['eod'] });
|
||||
expect(result.index.get('eod', 'AAPL.US')?.barCount).toBe(10);
|
||||
expect(result.index.get('eod', ' AAPL.US ')?.barCount).toBe(5);
|
||||
expect(result.index.sizeForSource('eod')).toBe(2);
|
||||
});
|
||||
|
||||
test('dispatcher rejects unknown sources', () => {
|
||||
expect(() => buildBarSpansPipeline('ib' as unknown as BarSpanSource)).toThrow(RangeError);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue