Skip to content

Commit

Permalink
fix: transaction-rules tests
Browse files Browse the repository at this point in the history
  • Loading branch information
UnderKoen committed Oct 9, 2024
1 parent a2a20f0 commit 1684d02
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions packages/loot-core/src/server/accounts/transaction-rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -165,7 +165,7 @@ describe('Transaction rules', () => {
});
expect(getRules().length).toBe(1);

transaction = runRules({
transaction = await runRules({
imported_payee: 'Kroger',
notes: '',
category: null,
Expand All @@ -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,
Expand All @@ -201,7 +201,7 @@ describe('Transaction rules', () => {
});
expect(getRules().length).toBe(1);

let transaction = runRules({
let transaction = await runRules({
payee: 'Kroger',
notes: '',
category: null,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
});
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -354,7 +354,7 @@ describe('Transaction rules', () => {
});

expect(
runRules({
await runRules({
imported_payee: '123 kroger',
date: '2020-08-11',
amount: 50,
Expand Down

0 comments on commit 1684d02

Please sign in to comment.