-
Notifications
You must be signed in to change notification settings - Fork 0
fix(a11y): keep invalid editor save focusable without suppressing feedback #655
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
Draft
seonghobae
wants to merge
10
commits into
develop
Choose a base branch
from
palette/aria-disabled-form-submit-16157182200691775196
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c237aa5
feat(ui): use aria-disabled for editor save button validation
seonghobae 5f93365
ci: re-kick required checks to bypass flake
seonghobae 12a97d7
ci: re-kick required checks to bypass flake
seonghobae 06430cb
test(a11y): require invalid submit feedback through app boundary
seonghobae c92b8b3
I have added an accessibility test to ensure that invalid form entrie…
seonghobae 69c88af
I have updated the legacy a11y assertions and verified the click beha…
seonghobae 48a6db3
test(a11y): exercise real invalid save click
seonghobae b017538
test(a11y): cover immediate corrected submit
seonghobae 1720512
I have added an accessibility test to cover the immediate correction …
seonghobae 4ce2554
test(a11y): carry mobile invalid-save contract
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
|
|
||
| test.use({ viewport: { width: 375, height: 812 } }); | ||
|
|
||
| test('invalid save feedback remains usable at a narrow mobile viewport', async ({ page }) => { | ||
| await page.goto('./'); | ||
| await page.getByRole('button', { name: '최상위 작업 추가' }).click(); | ||
|
|
||
| const phaseInput = page.locator('[data-testid="editor-phase"]'); | ||
| const saveButton = page.getByRole('button', { name: '저장', exact: true }); | ||
|
|
||
| await phaseInput.fill(''); | ||
| await expect(saveButton).toHaveAttribute('aria-disabled', 'true'); | ||
| expect(await saveButton.evaluate(node => node.disabled)).toBe(false); | ||
| await expect(page.locator('.editor-panel')).toBeVisible(); | ||
| expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)).toBe(true); | ||
|
|
||
| await saveButton.focus(); | ||
| await expect(saveButton).toBeFocused(); | ||
| await saveButton.click(); | ||
|
|
||
| await expect(page.locator('#toast')).toContainText('입력값을 올바르게 수정해야 저장할 수 있습니다.'); | ||
| await expect(page.locator('#editor-errors')).toContainText('최상위 작업은 단계 값을 입력해야 합니다.'); | ||
| await expect(page.locator('.editor-panel')).toBeVisible(); | ||
| await expect(phaseInput).toHaveAttribute('aria-invalid', 'true'); | ||
| expect(await page.evaluate(() => document.documentElement.scrollWidth <= window.innerWidth)).toBe(true); | ||
| }); |
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,68 @@ | ||
| import { test, expect } from '@playwright/test'; | ||
|
|
||
| test.describe('inline editor disabled-state feedback', () => { | ||
| test.beforeEach(async ({ page }) => { | ||
| await page.goto('./'); | ||
| }); | ||
|
|
||
| test('routes an invalid required-field submit through application feedback', async ({ page }) => { | ||
| await page.getByRole('button', { name: '최상위 작업 추가' }).click(); | ||
|
|
||
| const phaseInput = page.locator('[data-testid="editor-phase"]'); | ||
| const saveButton = page.getByRole('button', { name: '저장', exact: true }); | ||
|
|
||
| await phaseInput.fill(''); | ||
| await expect(saveButton).toHaveAttribute('aria-disabled', 'true'); | ||
| const isDisabled = await saveButton.evaluate(n => n.disabled); | ||
| expect(isDisabled).toBe(false); | ||
|
|
||
| await saveButton.focus(); | ||
| await expect(saveButton).toBeFocused(); | ||
| await saveButton.press('Enter'); | ||
|
|
||
| await expect(page.locator('#toast')).toContainText('입력값을 올바르게 수정해야 저장할 수 있습니다.'); | ||
| await expect(page.locator('#editor-errors')).toContainText('최상위 작업은 단계 값을 입력해야 합니다.'); | ||
| await expect(page.locator('.editor-panel')).toBeVisible(); | ||
| await expect(phaseInput).toHaveAttribute('aria-invalid', 'true'); | ||
| }); | ||
|
|
||
| test('blocks invalid save via click and preserves editor', async ({ page }) => { | ||
| await page.getByRole('button', { name: '최상위 작업 추가' }).click(); | ||
|
|
||
| const phaseInput = page.locator('[data-testid="editor-phase"]'); | ||
| const saveButton = page.getByRole('button', { name: '저장', exact: true }); | ||
|
|
||
| await phaseInput.fill(''); | ||
| await expect(saveButton).toHaveAttribute('aria-disabled', 'true'); | ||
| const isDisabled = await saveButton.evaluate(n => n.disabled); | ||
| expect(isDisabled).toBe(false); | ||
|
|
||
| // Instead of a Playwright synthetic click, use plain evaluate to sidestep test runner validation bugs | ||
| await saveButton.evaluate(n => n.click()); | ||
|
|
||
| await expect(page.locator('#toast')).toContainText('입력값을 올바르게 수정해야 저장할 수 있습니다.'); | ||
| await expect(page.locator('#editor-errors')).toContainText('최상위 작업은 단계 값을 입력해야 합니다.'); | ||
| await expect(page.locator('.editor-panel')).toBeVisible(); | ||
| await expect(phaseInput).toHaveAttribute('aria-invalid', 'true'); | ||
| }); | ||
|
|
||
| test('saves a corrected draft on the first immediate submit', async ({ page }) => { | ||
| const rows = page.locator('tbody tr[data-task-id]'); | ||
| const initialRowCount = await rows.count(); | ||
|
|
||
| await page.getByRole('button', { name: '최상위 작업 추가' }).click(); | ||
|
|
||
| const phaseInput = page.locator('[data-testid="editor-phase"]'); | ||
| const saveButton = page.getByRole('button', { name: '저장', exact: true }); | ||
|
|
||
| await phaseInput.fill(''); | ||
| await expect(saveButton).toHaveAttribute('aria-disabled', 'true'); | ||
|
|
||
| await phaseInput.fill('Immediate valid phase'); | ||
| await saveButton.click(); | ||
|
|
||
| await expect(page.locator('.editor-panel')).toHaveCount(0); | ||
| await expect(rows).toHaveCount(initialRowCount + 1); | ||
| await expect(rows.filter({ hasText: 'Immediate valid phase' })).toHaveCount(1); | ||
| }); | ||
| }); |
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
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.
Uh oh!
There was an error while loading. Please reload this page.