A local-first personal finance app
Allow rendering a schedule in <Value /> (#706)
Jed Fox80e135e38f5a
diff --git a/packages/desktop-client/e2e/page-models/rules-page.js b/packages/desktop-client/e2e/page-models/rules-page.jsindex bd58245994..40f79d5a50 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.jsindex 383b19a316..bdedea7cd0 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.jsindex 3c194c3fb7..2d96ecc468 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 pageawait navigation.goToSchedulesPage();await schedulesPage.completeNthSchedule(0);diff --git a/packages/desktop-client/src/components/ManageRules.js b/packages/desktop-client/src/components/ManageRules.jsindex 072303d47d..7fa9fea110 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;}