Skip to content

Commit cf2a4d5

Browse files
committed
test(dogfood): read the filled column back before the report
1 parent 5d42227 commit cf2a4d5

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

‎packages/qa/dogfood/test/home-amount-added-to-existing-object.test.ts‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,19 +234,21 @@ for (const cell of CELLS) {
234234
for (const row of ROWS) expect((await stored(row.id)).home).toBeNull();
235235

236236
const applied = await run(true);
237-
expect(applied).toMatchObject({ amounts: 4, changed: 3, written: 3, skippedTotal: 1, failures: [] });
238-
expect(applied.skipped).toEqual([
239-
{ recordId: 'up_sek', organizationId: DEFAULT_ORGANIZATION_ID, field: 'amount', reason: 'rate_missing', currency: 'SEK', date: '2026-03-15' },
240-
]);
241-
expect(homeAmountRecomputeComplete(applied)).toBe(false);
242-
243-
// The ADR's own figures: USD 10,000 at 0.1389 is ¥71,994.24; the same currency is rate 1, rounded once.
237+
// What the column holds, read back: the ADR's own figures (USD 10,000 at
238+
// 0.1389 is ¥71,994.24; the same currency is rate 1, rounded once).
244239
expect(await stored('up_usd_march')).toMatchObject({ home: 71994.24, rate: 0.1389 });
245240
expect(await stored('up_usd_april')).toMatchObject({ home: 10000, rate: 0.15 });
246241
expect(await stored('up_cny')).toMatchObject({ home: 12.35, rate: 1 });
247242
// The skipped row keeps a blank home field, never a fallback.
248243
expect(await stored('up_sek')).toMatchObject({ home: null, rate: null });
249244

245+
// What the run reported.
246+
expect(applied).toMatchObject({ amounts: 4, changed: 3, written: 3, skippedTotal: 1, failures: [] });
247+
expect(applied.skipped).toEqual([
248+
{ recordId: 'up_sek', organizationId: DEFAULT_ORGANIZATION_ID, field: 'amount', reason: 'rate_missing', currency: 'SEK', date: '2026-03-15' },
249+
]);
250+
expect(homeAmountRecomputeComplete(applied)).toBe(false);
251+
250252
// Equal to a fresh write of the same row, after the upgrade.
251253
for (const row of ROWS.filter((r) => r.id !== 'up_sek')) {
252254
const { id: _old, ...values } = row;

0 commit comments

Comments
 (0)