-
Notifications
You must be signed in to change notification settings - Fork 6
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
test: add accessibility-checker for additional tests #2652
base: main
Are you sure you want to change the base?
Changes from 1 commit
85dbe82
bd953d3
0cd57c4
657d4e8
15f2a84
abbf700
b1301d0
ef7fbef
9e88189
07237ab
801f695
bc6265a
2fecc7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,7 @@ export default function DBTooltip(props: DBTooltipProps) { | |
return ( | ||
<i | ||
role="tooltip" | ||
aria-hidden="true" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does the i-tag have to be 'aria-hidden'? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We add |
||
ref={ref} | ||
className={cls('db-tooltip', props.className)} | ||
id={props.id} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
@if (variantRef) { | ||
<db-card class="variants-card" [elevationLevel]="getElevation()"> | ||
<div | ||
[attr.aria-label]="variantRef.name" | ||
[attr.aria-label]="variantRef.role ? variantRef.name : undefined" | ||
[attr.role]="variantRef.role" | ||
class="variants-list" | ||
> | ||
|
@@ -48,7 +48,13 @@ <h1>{{ title }}</h1> | |
class="variants-card" | ||
[elevationLevel]="getElevation()" | ||
> | ||
<div class="variants-list"> | ||
<div | ||
[attr.aria-label]=" | ||
variant.role ? variant.name : undefined | ||
" | ||
[attr.role]="variant.role" | ||
class="variants-list" | ||
> | ||
Comment on lines
+51
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wouldn't it be better for readability to name the class first, i.e. before the aria attributes? |
||
@for ( | ||
example of variant.examples; | ||
track example; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import { expect, type Page, test } from '@playwright/test'; | ||
Check failure on line 1 in showcases/e2e/default.ts
|
||
import AxeBuilder from '@axe-core/playwright'; | ||
// @ts-expect-error - required for playwright | ||
import { close, getCompliance } from 'accessibility-checker'; | ||
import { type ICheckerError } from 'accessibility-checker/lib/api/IChecker'; | ||
import { COLORS } from './fixtures/variants.ts'; | ||
// @ts-expect-error - required for playwright | ||
import { setScrollViewport } from './fixtures/viewport.ts'; | ||
import { COLORS } from './fixtures/variants'; | ||
import { setScrollViewport } from './fixtures/viewport'; | ||
|
||
const density = 'regular'; | ||
|
||
|
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.
Is the prop _checked written with underscore to differentiate it from the native checked e.g. of checkboxes?
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.
We used "_" to mark this as a state (
state._checked
) property. There is also aprops.checked
which would be confusing otherwise