참고소스 수정본

This commit is contained in:
LASTA_DEV01\lasta
2026-05-12 19:40:31 +09:00
parent 0f34a451fc
commit 2e9204243d
8708 changed files with 3259488 additions and 869 deletions

View File

@@ -0,0 +1,28 @@
// spec: specs/editing-todos.plan.md
// seed: tests/seed.spec.ts
import { test, expect } from '../fixtures';
test.describe('Editing Todos', () => {
test('should-cancel-edit-on-escape', async ({ page }) => {
// 1. Add a todo 'Original text'
await page.getByRole('textbox', { name: 'What needs to be done?' }).fill('Original text');
await page.getByRole('textbox', { name: 'What needs to be done?' }).press('Enter');
// Expect: The todo appears in the list
await expect(page.getByText('Original text')).toBeVisible();
// 2. Double-click on the todo to enter edit mode
await page.getByTestId('todo-title').dblclick();
// Expect: Edit textbox appears with 'Original text'
await expect(page.getByRole('textbox', { name: 'Edit' })).toHaveValue('Original text');
// 3. Change the text to 'Modified text' but press Escape instead of Enter
await page.getByRole('textbox', { name: 'Edit' }).fill('Modified text');
await page.keyboard.press('Escape');
// Expect: Edit mode is cancelled, The todo text reverts to 'Original text', Changes are not saved
await expect(page.getByText('Original text')).toBeVisible();
});
});