Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion playwright/e2e/sign-herself-with-drawn-signature.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,23 @@ test('sign herself with drawn signature', async ({ page }) => {

await page.getByRole('button', { name: 'Define your signature.' }).click();

await page.getByRole('dialog', { name: 'Customize your signatures' }).locator('canvas').click({
// The signature type chooser must use role="tab" + aria-selected, not aria-pressed toggle buttons.
// Screen readers announce role="tab" as "tab, 1 of 3" which lets blind users understand the widget.
// With aria-pressed buttons they only hear "toggle button, pressed" with no tab count context.
const signatureDialog = page.getByRole('dialog', { name: 'Customize your signatures' })
await expect(signatureDialog.getByRole('tab', { name: 'Draw' })).toBeVisible()
await expect(signatureDialog.getByRole('tab', { name: 'Text' })).toBeVisible()
await expect(signatureDialog.getByRole('tab', { name: 'Upload' })).toBeVisible()
await expect(signatureDialog.getByRole('tab', { name: 'Draw' })).toHaveAttribute('aria-selected', 'true')

// Navigate to a different tab and back — verifies aria-selected updates correctly
await signatureDialog.getByRole('tab', { name: 'Text' }).click()
await expect(signatureDialog.getByRole('tab', { name: 'Text' })).toHaveAttribute('aria-selected', 'true')
await expect(signatureDialog.getByRole('tab', { name: 'Draw' })).toHaveAttribute('aria-selected', 'false')
await signatureDialog.getByRole('tab', { name: 'Draw' }).click()
await expect(signatureDialog.getByRole('tab', { name: 'Draw' })).toHaveAttribute('aria-selected', 'true')

await signatureDialog.locator('canvas').click({
position: {
x: 156,
y: 132
Expand Down
3 changes: 2 additions & 1 deletion src/components/Draw/Draw.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
<NcButton
v-for="tab in availableTabs"
:key="tab.id"
role="tab"
class="draw-signature__tab"
:class="{ 'draw-signature__tab--active': activeTab === tab.id }"
variant="tertiary"
:aria-pressed="activeTab === tab.id"
:aria-selected="activeTab === tab.id"
@click="activeTab = tab.id">
<NcIconSvgWrapper :path="tab.icon" :size="18" />
<span class="draw-signature__tab-label">{{ tab.label }}</span>
Expand Down
Loading