Files
chore/frontend/vue-app/e2e/mode_parent/tasks/penalty-convert-default.spec.ts
Ryan Kegel f250c42e5e
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 3m31s
Add end-to-end tests for parent item management
- 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.
2026-03-12 12:22:37 -04:00

25 lines
981 B
TypeScript

// 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 penalty to a user item by editing', async ({ page }) => {
await page.goto('/parent/tasks/chores')
await page.click('text=Penalties')
// locate default penalty
await expect(page.locator('text=Fighting')).toBeVisible()
await expect(page.locator('text=Fighting >> .. >> button[aria-label="Delete item"]')).toHaveCount(
0,
)
// edit it (click the item itself)
await page.getByText('Fighting', { exact: true }).click()
await page.locator('#name').fill('Fighting (custom)')
await page.locator('#points').fill('15')
await expect(page.getByRole('button', { name: 'Save' })).toBeEnabled()
await page.getByRole('button', { name: 'Save' }).click()
// now should have delete option
await expect(
page.locator('text=Fighting >> .. >> button[aria-label="Delete item"]'),
).toBeVisible()
})