From 1684d020b61cd4760cd03965507d21d209871304 Mon Sep 17 00:00:00 2001 From: UnderKoen Date: Wed, 9 Oct 2024 22:10:19 +0200 Subject: [PATCH] fix: transaction-rules tests --- .../server/accounts/transaction-rules.test.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/loot-core/src/server/accounts/transaction-rules.test.ts b/packages/loot-core/src/server/accounts/transaction-rules.test.ts index 3ca6834d99d..4a043e0ef09 100644 --- a/packages/loot-core/src/server/accounts/transaction-rules.test.ts +++ b/packages/loot-core/src/server/accounts/transaction-rules.test.ts @@ -126,7 +126,7 @@ describe('Transaction rules', () => { spy.mockRestore(); // Finally make sure the rule is actually in place and runs - const transaction = runRules({ + const transaction = await runRules({ date: '2019-05-10', notes: '', category: null, @@ -149,7 +149,7 @@ describe('Transaction rules', () => { }); expect(getRules().length).toBe(1); - let transaction = runRules({ + let transaction = await runRules({ imported_payee: 'Kroger', notes: '', category: null, @@ -165,7 +165,7 @@ describe('Transaction rules', () => { }); expect(getRules().length).toBe(1); - transaction = runRules({ + transaction = await runRules({ imported_payee: 'Kroger', notes: '', category: null, @@ -179,7 +179,7 @@ describe('Transaction rules', () => { id, conditions: [{ op: 'is', field: 'imported_payee', value: 'ABC' }], }); - transaction = runRules({ + transaction = await runRules({ imported_payee: 'ABC', notes: '', category: null, @@ -201,7 +201,7 @@ describe('Transaction rules', () => { }); expect(getRules().length).toBe(1); - let transaction = runRules({ + let transaction = await runRules({ payee: 'Kroger', notes: '', category: null, @@ -211,7 +211,7 @@ describe('Transaction rules', () => { await deleteRule(id); expect(getRules().length).toBe(0); - transaction = runRules({ + transaction = await runRules({ payee: 'Kroger', notes: '', category: null, @@ -242,14 +242,14 @@ describe('Transaction rules', () => { await loadRules(); expect(getRules().length).toBe(2); - let transaction = runRules({ + let transaction = await runRules({ imported_payee: 'blah Lowes blah', payee: null, category: null, }); expect(transaction.payee).toBe('lowes'); - transaction = runRules({ + transaction = await runRules({ imported_payee: 'kroger', category: null, }); @@ -315,7 +315,7 @@ describe('Transaction rules', () => { expect(rule2.conditions[1].value).toBe('beer_id'); }); - test('runRules runs all the rules in each phase', async () => { + test('await runRules runs all the rules in each phase', async () => { await loadRules(); await insertRule({ stage: 'post', @@ -354,7 +354,7 @@ describe('Transaction rules', () => { }); expect( - runRules({ + await runRules({ imported_payee: '123 kroger', date: '2020-08-11', amount: 50,