Merge main (handover test-fix d51d3d7) into Tane rename

This commit is contained in:
vjrj 2026-07-12 13:28:58 +02:00
commit af62ca3c03
2 changed files with 64 additions and 2 deletions

View file

@ -84,13 +84,21 @@ void main() {
await tester.tap(find.byKey(const Key('handover.save')));
await tester.pumpAndSettle();
final sales = await repo.watchSales().first;
// One-shot .get() reads (NOT watch().first): a Drift stream's `.first`
// never completes under the widget-test fake-async clock, so awaiting it
// in a testWidgets body hangs the whole test to the 10-min hard cap. A
// plain SELECT resolves fine (same as the movements/lot reads below).
final sales = await (db.select(
db.sales,
)..where((s) => s.isDeleted.equals(false))).get();
expect(sales.single.direction, SaleDirection.iSold);
expect(sales.single.amount, 2.5);
expect(sales.single.currency, 'Ğ1');
expect(sales.single.counterparty, 'María');
final plantares = await repo.watchPlantares().first;
final plantares = await (db.select(
db.plantares,
)..where((p) => p.isDeleted.equals(false))).get();
expect(plantares.single.direction, PlantareDirection.owedToMe);
expect(plantares.single.owedDescription, 'un puñado');