From 3aba528c8713588065acc668007e24aa10356e2c Mon Sep 17 00:00:00 2001 From: PJ Date: Mon, 1 Jun 2026 21:12:29 +0530 Subject: [PATCH] fix(folio-web): seed card/txn-type selection via from().generate() for reproducible runs --- examples/folio-web/sanderling/spec.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/folio-web/sanderling/spec.ts b/examples/folio-web/sanderling/spec.ts index 1952eff..a0b7296 100644 --- a/examples/folio-web/sanderling/spec.ts +++ b/examples/folio-web/sanderling/spec.ts @@ -205,8 +205,7 @@ const openAccount = actions(() => { if (!onHomePage.current) return []; const cards = accountCards.current; if (cards.length === 0) return []; - const card = cards[Math.floor(Math.random() * cards.length)]; - return [Tap({ on: card.element })]; + return [Tap({ on: from(cards).generate().element })]; }); const openAddTxn = actions(() => { @@ -252,10 +251,9 @@ const typeNote = actions(() => { const toggleTxnType = actions(() => { if (!onAddTxnPage.current) return []; - const credit = txnCreditButton.current; - const debit = txnDebitButton.current; - const target = Math.random() < 0.5 ? credit : debit; - return target ? [Tap({ on: target })] : []; + const targets = [txnCreditButton.current, txnDebitButton.current].filter(Boolean); + if (targets.length === 0) return []; + return [Tap({ on: from(targets).generate() })]; }); const submitTxn = actions(() => {