()
| 412 | } |
| 413 | |
| 414 | function expectConsistent(): void { |
| 415 | for (const day of MISSED) { |
| 416 | const l = ledger(day); |
| 417 | // Nothing lost and nothing counted twice, however far the fold got. |
| 418 | expect(l.folded + l.unfolded, day).toBe(LEGACY_ROWS[day]); |
| 419 | if (l.rolledUp) { |
| 420 | expect(l, day).toMatchObject({ unfolded: 0, rolledUsage: LEGACY_ROWS[day] }); |
| 421 | } else { |
| 422 | // A day whose fold did not finish gets no rollup at all, so it stays "missed". |
| 423 | expect(l.rolledUsage, day).toBeNull(); |
| 424 | } |
| 425 | } |
| 426 | } |
| 427 | |
| 428 | beforeEach(() => { |
| 429 | for (const day of MISSED) seedLegacyDay(day, LEGACY_ROWS[day]!); |
no test coverage detected