mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-04 20:17:09 +00:00
refactor(folio): drop doubleSubmitTxn; fuzzer surfaces double-submit via defaultActions
This commit is contained in:
1 parent
801f09d455
commit
aa42b8e504
1 file changed
+2
-15
@@ -1,6 +1,4 @@
|
|||||||
// Reproduce noDuplicateTxnPerStep on a fresh AVD: `SEED=0 DURATION=2m just test`.
|
|
||||||
import {
|
import {
|
||||||
DoubleTap,
|
|
||||||
InputText,
|
InputText,
|
||||||
Tap,
|
Tap,
|
||||||
actions,
|
actions,
|
||||||
@@ -194,16 +192,6 @@ const addTxn = whenRoute(route, ["home", "ledger", "add-transaction"], () => {
|
|||||||
return opts;
|
return opts;
|
||||||
});
|
});
|
||||||
|
|
||||||
const doubleSubmitTxn = whenRoute(route, "add-transaction", () => {
|
|
||||||
const field = txnAmountField.current;
|
|
||||||
const submit = txnSubmit.current;
|
|
||||||
if (!field || !submit) return [];
|
|
||||||
return [
|
|
||||||
InputText({ into: field, text: amounts.generate() }),
|
|
||||||
DoubleTap({ on: submit }),
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
export const properties = {
|
export const properties = {
|
||||||
newAccountBalanceIsZero,
|
newAccountBalanceIsZero,
|
||||||
noDuplicateTxnPerStep,
|
noDuplicateTxnPerStep,
|
||||||
@@ -216,10 +204,9 @@ export const setup = login;
|
|||||||
// adds breadth so the fuzzer wanders the whole app and types edge-case values
|
// adds breadth so the fuzzer wanders the whole app and types edge-case values
|
||||||
// into every field, stressing the balance invariants above.
|
// into every field, stressing the balance invariants above.
|
||||||
export const actionsRoot = weighted(
|
export const actionsRoot = weighted(
|
||||||
[40, addAccount],
|
[50, addAccount],
|
||||||
[30, addTxn],
|
[30, addTxn],
|
||||||
[15, doubleSubmitTxn],
|
[20, defaultActions],
|
||||||
[15, defaultActions],
|
|
||||||
);
|
);
|
||||||
|
|
||||||
(globalThis as { actions?: unknown; properties?: unknown; setup?: unknown }).actions = actionsRoot;
|
(globalThis as { actions?: unknown; properties?: unknown; setup?: unknown }).actions = actionsRoot;
|
||||||
|
|||||||
Reference in new issue
Block a user