temp changes
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m59s
All checks were successful
Chore App Build, Test, and Push Docker Images / build-and-push (push) Successful in 2m59s
This commit is contained in:
21
frontend/vue-app/e2e/create-child/navigation.spec.ts
Normal file
21
frontend/vue-app/e2e/create-child/navigation.spec.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
// spec: e2e/plans/create-child.plan.md
|
||||
|
||||
import { test, expect } from '@playwright/test'
|
||||
|
||||
test.describe('Create Child', () => {
|
||||
test('Cancel navigates back without saving', async ({ page }) => {
|
||||
// 1. Navigate to app root - router redirects to /parent (children list)
|
||||
await page.goto('/')
|
||||
await page.getByRole('button', { name: 'Add Child' }).click()
|
||||
await expect(page.getByRole('heading', { name: 'Create Child' })).toBeVisible()
|
||||
|
||||
// 2. Fill in 'Frank' and '9', then click Cancel
|
||||
await page.getByLabel('Name').fill('Frank')
|
||||
await page.getByLabel('Age').fill('9')
|
||||
await page.getByRole('button', { name: 'Cancel' }).click()
|
||||
|
||||
// expect: back on /parent and 'Frank' is NOT listed
|
||||
await expect(page).toHaveURL('/parent')
|
||||
await expect(page.getByText('Frank')).not.toBeVisible()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user