()
| 376 | } |
| 377 | |
| 378 | function expectConsistent(): void { |
| 379 | for (const day of MISSED) { |
| 380 | const l = ledger(day); |
| 381 | // Nothing lost and nothing counted twice, however far the fold got. |
| 382 | expect(l.folded + l.unfolded, day).toBe(LEGACY_ROWS[day]); |
| 383 | if (l.rolledUp) { |
| 384 | expect(l, day).toMatchObject({ unfolded: 0, rolledUsage: LEGACY_ROWS[day] }); |
| 385 | } else { |
| 386 | // A day whose fold did not finish gets no rollup at all, so it stays "missed". |
| 387 | expect(l.rolledUsage, day).toBeNull(); |
| 388 | } |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | beforeEach(() => { |
| 393 | for (const day of MISSED) seedLegacyDay(day, LEGACY_ROWS[day]!); |
no test coverage detected