From c94749aace5a4c603f26862429893067db59157e Mon Sep 17 00:00:00 2001 From: Tom French Date: Mon, 27 Jun 2022 01:20:14 +0100 Subject: [PATCH] test: make all frequency weights be integer values --- packages/loot-core/src/mocks/arbitrary-schema.js | 4 ++-- packages/loot-core/src/server/aql/schema/executors.test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/loot-core/src/mocks/arbitrary-schema.js b/packages/loot-core/src/mocks/arbitrary-schema.js index 6b4d8d6..f080582 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 69554a2..4a33e04 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 }),