test(export): stale-group + same-date ordinal coverage; comment/guard polish

This commit is contained in:
Experiments DB Dev
2026-07-19 15:18:56 -04:00
parent 33ee191966
commit 4f3fe64cad
4 changed files with 25 additions and 2 deletions
+10
View File
@@ -237,6 +237,16 @@ describe('buildSampleIndex', () => {
expect(idx.get('a1').get(250).date).toContain('2026-07-01');
expect(idx.get('a1').get(260).date).toContain('2026-07-03');
});
it('# days reach counts per-status, not per-distinct-date (same-day statuses get separate ordinals)', () => {
const sameDay = [
{ animal_id: 'z1', date: '2026-07-01T08:00:00Z', analysis_summary: { total: 1 } },
{ animal_id: 'z1', date: '2026-07-01T20:00:00Z', analysis_summary: { total: 2 } },
];
const idx = buildSampleIndex(sameDay, '__days__', []);
expect(idx.get('z1').has(1)).toBe(true);
expect(idx.get('z1').has(2)).toBe(true);
expect(idx.get('z1').has(3)).toBe(false);
});
});
import { buildSubjectSeriesMatrix } from '../src/lib/dataExport';