diff --git a/packages/desktop-client/e2e/page-models/rules-page.js b/packages/desktop-client/e2e/page-models/rules-page.js index bd582459940c0594e69355f26b9f99d1ff33f550..40f79d5a50ffb7b3cd48dfc6c008cee37a8cffc7 100644 --- a/packages/desktop-client/e2e/page-models/rules-page.js +++ b/packages/desktop-client/e2e/page-models/rules-page.js @@ -26,8 +26,12 @@ export class RulesPage { const row = this.page.getByTestId('table').getByTestId('row').nth(index); return { - conditions: await row.getByTestId('conditions').textContent(), - actions: await row.getByTestId('actions').textContent(), + conditions: await row + .getByTestId('conditions') + .evaluate(el => [...el.children].map(c => c.textContent)), + actions: await row + .getByTestId('actions') + .evaluate(el => [...el.children].map(c => c.textContent)), }; } diff --git a/packages/desktop-client/e2e/rules.test.js b/packages/desktop-client/e2e/rules.test.js index 383b19a316deadd90e37fffec0af5476902f9b24..bdedea7cd02012ea0583402a16795f82f3b0bda0 100644 --- a/packages/desktop-client/e2e/rules.test.js +++ b/packages/desktop-client/e2e/rules.test.js @@ -44,8 +44,8 @@ test.describe('Rules', () => { }); expect(await rulesPage.getNthRule(0)).toMatchObject({ - conditions: 'payee is Fast Internet', - actions: 'set category to General', + conditions: ['payee is Fast Internet'], + actions: ['set category to General'], }); const accountPage = await navigation.goToAccountPage('Bank of America'); diff --git a/packages/desktop-client/e2e/schedules.test.js b/packages/desktop-client/e2e/schedules.test.js index 3c194c3fb78a2af9d7b6df590aa091a49c385a04..2d96ecc468e9d27fe608bf3f7b8bd700fe619961 100644 --- a/packages/desktop-client/e2e/schedules.test.js +++ b/packages/desktop-client/e2e/schedules.test.js @@ -54,6 +54,18 @@ test.describe('Schedules', () => { credit: '', }); + // go to rules page + const rulesPage = await navigation.goToRulesPage(); + expect(await rulesPage.getNthRule(0)).toMatchObject({ + actions: ['link schedule Home Depot (2023-02-28)'], + conditions: [ + 'payee is Home Depot', + 'account is HSBC', + 'date is approx Every month on the 28th', + 'amount is approx -25.00', + ], + }); + // Go back to schedules page await navigation.goToSchedulesPage(); await schedulesPage.completeNthSchedule(0); diff --git a/packages/desktop-client/src/components/ManageRules.js b/packages/desktop-client/src/components/ManageRules.js index 072303d47dae9557a82cae4b23819ea76dc7eaf3..7fa9fea1102cb827e7285b215754c560d2f1d3ca 100644 --- a/packages/desktop-client/src/components/ManageRules.js +++ b/packages/desktop-client/src/components/ManageRules.js @@ -117,6 +117,7 @@ export function Value({ case 'payee': case 'category': case 'account': + case 'rule': if (valueIsRaw) { return value; }