-
Notifications
You must be signed in to change notification settings - Fork 0
fix(a11y): synchronize editor validation before save #600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
9dce0e3
test(a11y): reproduce editor validation submission race
seonghobae aa5c904
test(ci): run editor synchronization regression in required e2e
seonghobae 824efe3
test(a11y): verify valid save drops error relationship
seonghobae 12c0ff5
fix(a11y): keep editor save validation discoverable
seonghobae 5699303
test(a11y): distinguish native and ARIA disabled state
seonghobae 193c302
test(security): cover fullwidth CSV formula prefixes
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
|
|
||
| async function openRootEditor(page) { | ||
| await page.goto('./'); | ||
| const initialTaskCount = await page.locator('tbody tr[data-task-id]').count(); | ||
| await page.getByRole('button', { name: '최상위 작업 추가' }).click(); | ||
| const editor = page.locator('.editor-panel'); | ||
| const phaseInput = page.getByTestId('editor-phase'); | ||
| const saveButton = editor.getByRole('button', { name: '저장', exact: true }); | ||
| await expect(editor).toBeVisible(); | ||
| return { initialTaskCount, editor, phaseInput, saveButton }; | ||
| } | ||
|
|
||
| test('valid final edit can submit immediately without waiting for debounced validation', async ({ page }) => { | ||
| const { initialTaskCount, editor, phaseInput, saveButton } = await openRootEditor(page); | ||
|
|
||
| await expect(saveButton).toHaveJSProperty('disabled', false); | ||
| await expect(saveButton).toHaveAttribute('aria-disabled', 'true'); | ||
| await expect(saveButton).toHaveAttribute('aria-describedby', 'editor-errors'); | ||
|
seonghobae marked this conversation as resolved.
|
||
|
|
||
| await phaseInput.fill('P9000.즉시 저장 검증'); | ||
| await saveButton.evaluate((button) => button.click()); | ||
|
|
||
| await expect(editor).toHaveCount(0); | ||
| await expect(page.locator('tbody tr[data-task-id]')).toHaveCount(initialTaskCount + 1); | ||
| }); | ||
|
|
||
| test('Enter after the final required edit submits against the latest draft', async ({ page }) => { | ||
| const { initialTaskCount, editor, phaseInput } = await openRootEditor(page); | ||
|
|
||
| await phaseInput.fill('P9001.키보드 즉시 저장'); | ||
| await phaseInput.press('Enter'); | ||
|
|
||
| await expect(editor).toHaveCount(0); | ||
| await expect(page.locator('tbody tr[data-task-id]')).toHaveCount(initialTaskCount + 1); | ||
| }); | ||
|
|
||
| test('invalid immediate activation stays focusable, refreshes errors, and persists nothing', async ({ page }) => { | ||
| const { initialTaskCount, editor, phaseInput, saveButton } = await openRootEditor(page); | ||
|
|
||
| await phaseInput.fill('P9002.유효 상태'); | ||
| await expect(saveButton).not.toHaveAttribute('aria-disabled', 'true'); | ||
| await expect(saveButton).not.toHaveAttribute('aria-describedby', 'editor-errors'); | ||
|
|
||
| await phaseInput.fill(''); | ||
| await saveButton.evaluate((button) => { | ||
| button.focus(); | ||
| button.click(); | ||
| }); | ||
|
|
||
| await expect(editor).toBeVisible(); | ||
| await expect(page.locator('tbody tr[data-task-id]')).toHaveCount(initialTaskCount); | ||
| await expect(saveButton).toHaveJSProperty('disabled', false); | ||
| await expect(saveButton).toBeFocused(); | ||
| await expect(saveButton).toHaveAttribute('aria-disabled', 'true'); | ||
| await expect(saveButton).toHaveAttribute('aria-describedby', 'editor-errors'); | ||
| await expect(page.locator('#editor-errors')).toContainText('최상위 작업은 단계 값을 입력해야 합니다.'); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 Info: Invalid save now blocked only by synchronous save-time validation
Switching the save button from native
disabledtoaria-disabled(app.js:1074-1080) leaves it always operable. Invalid submits are now gated solely by the synchronous re-validation insaveEditor()(app.js:1245-1250), reached afterrenderDraftValidation.flush()in the submit handler (app.js:426-434). The debounced validation only drives presentation, so the stale aria-disabled window between a keystroke and the 150ms debounce neither rejects a valid submit nor admits an invalid one.Was this helpful? React with 👍 or 👎 to provide feedback.