Skip to content

A local-first personal finance app

test: make all frequency weights be integer values

Tom Frenchc94749aace5a
diff --git a/packages/loot-core/src/mocks/arbitrary-schema.js b/packages/loot-core/src/mocks/arbitrary-schema.js
index 6b4d8d6e89..f080582c03 100644
--- a/packages/loot-core/src/mocks/arbitrary-schema.js
+++ b/packages/loot-core/src/mocks/arbitrary-schema.js
@@ -116,7 +116,7 @@ function tableArbitrary(tableSchema, extraArbs, requiredKeys = []) {
return arb;
}
-function makeTransaction({ splitFreq = 1, payeeIds } = {}) {
+function makeTransaction({ splitFreq = 100, payeeIds } = {}) {
let payeeField = payeeIds
? { payee: fc.oneof(...payeeIds.map(id => fc.constant(id))) }
: null;
@@ -128,7 +128,7 @@ function makeTransaction({ splitFreq = 1, payeeIds } = {}) {
{
...payeeField,
subtransactions: fc.frequency(
- { arbitrary: fc.constant([]), weight: 1 },
+ { arbitrary: fc.constant([]), weight: 100 },
{ arbitrary: fc.array(subtrans), weight: splitFreq }
)
},
diff --git a/packages/loot-core/src/server/aql/schema/executors.test.js b/packages/loot-core/src/server/aql/schema/executors.test.js
index 69554a2338..4a33e04c57 100644
--- a/packages/loot-core/src/server/aql/schema/executors.test.js
+++ b/packages/loot-core/src/server/aql/schema/executors.test.js
@@ -319,7 +319,7 @@ describe('transaction executors', () => {
fc
.asyncProperty(
arbs.makeTransactionArray({
- splitFreq: 0.1,
+ splitFreq: 10,
payeeIds,
maxLength: 100
}),