Add end-to-end tests for task modification and assignment features
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m33s

- Implemented tests for editing penalty points and reward costs in `penalty-edit-points.spec.ts` and `reward-edit-cost.spec.ts`.
- Created detailed plans for task activation and assignment scenarios in `task-activated.plan.md` and `task-assignment.plan.md`.
- Added comprehensive test cases for modifying tasks, including editing points for chores, kindness acts, penalties, and rewards in `task-modified.plan.md`.
- Ensured all tests are isolated and run in serial mode to maintain state integrity.
This commit is contained in:
2026-03-17 22:46:27 -04:00
parent b2115ceb57
commit a9131242a7
28 changed files with 3724 additions and 106 deletions

View File

@@ -11,13 +11,14 @@ test.describe('Reward cancellation', () => {
test.describe.configure({ mode: 'serial' })
test('Cancel reward creation', async ({ page }) => {
const name = `CancelMe-${Date.now()}`
// 1. Navigate and open create form
await page.goto('/parent/rewards')
await page.getByRole('button', { name: 'Create Reward' }).click()
await expect(page.locator('text=Reward Name')).toBeVisible()
// 2. Fill then cancel
await page.evaluate(() => {
await page.evaluate((n) => {
const setVal = (sel: string, val: string) => {
const el = document.querySelector(sel) as HTMLInputElement | null
if (el) {
@@ -26,13 +27,13 @@ test.describe('Reward cancellation', () => {
el.dispatchEvent(new Event('change', { bubbles: true }))
}
}
setVal('#name', 'Test')
setVal('#name', n)
setVal('#cost', '5')
})
}, name)
await page.getByRole('button', { name: 'Cancel' }).click()
// verify return to list and no "Test" item
await expect(page.getByText('Test')).toHaveCount(0)
// verify return to list and the cancelled item was not saved
await expect(page.getByText(name, { exact: true })).toHaveCount(0)
})
test('Cancel reward edit', async ({ page }) => {
@@ -74,4 +75,4 @@ test.describe('Reward cancellation', () => {
await expect(page.locator('text=Should not save')).toHaveCount(0)
await expect(page.locator(`text=${original}`)).toBeVisible()
})
})
})