Add end-to-end tests for parent item management
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m31s

- Implement tests for creating, editing, and deleting chores, kindness acts, and penalties.
- Add tests to verify conversion of default items to user items and restoration of system defaults upon deletion.
- Ensure proper cancellation of creation and editing actions.
- Create a comprehensive plan document outlining the test scenarios and expected behaviors.
This commit is contained in:
2026-03-12 12:22:37 -04:00
parent accf596bd7
commit f250c42e5e
32 changed files with 1995 additions and 197 deletions

View File

@@ -0,0 +1,34 @@
// spec: frontend/vue-app/e2e/plans/parent-item-management.plan.md
// seed: e2e/seed.spec.ts
import { test, expect } from '@playwright/test'
test('Convert a default kindness act to a user item by editing', async ({ page }) => {
await page.goto('/parent/tasks/chores')
await page.click('text=Kindness Acts')
// find a default act
await expect(page.locator('text=Be good for the day')).toBeVisible()
await expect(
page.locator('text=Be good for the day >> .. >> button[aria-label="Delete item"]'),
).toHaveCount(0)
// edit it — rename to avoid name collision with kindness-delete-default running in parallel
await page.click('text=Be good for the day')
await page.locator('#name').fill('Be good today (edited)')
await page.locator('#points').fill('7')
await page.getByRole('button', { name: 'Save' }).click()
// renamed item should now be deletable
await expect(
page
.getByText('Be good today (edited)', { exact: true })
.locator('..')
.locator('button[aria-label="Delete item"]'),
).toBeVisible()
// clean up: delete the created user item so other tests see a clean default state
await page
.getByText('Be good today (edited)', { exact: true })
.locator('..')
.locator('button[aria-label="Delete item"]')
.click()
await page.getByRole('button', { name: 'Delete', exact: true }).click()
})