Skip to content
Snippets Groups Projects
Unverified Commit 80e135e3 authored by Jed Fox's avatar Jed Fox Committed by GitHub
Browse files

Allow rendering a schedule in <Value /> (#706)

* Allow rendering a schedule rule in <Value />

* Refactor: RulesPage.getNthRule returns arrays for conditions/actions

* Visit the rules page after creating a schedule
parent 8cff0ba7
No related branches found
No related tags found
No related merge requests found
......@@ -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)),
};
}
......
......@@ -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');
......
......@@ -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);
......
......@@ -117,6 +117,7 @@ export function Value({
case 'payee':
case 'category':
case 'account':
case 'rule':
if (valueIsRaw) {
return value;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment