Skip to content

Commit

Permalink
fix(Breadcrumb): improve accessibility (#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
thaytharma authored Jan 5, 2022
1 parent 17a1de0 commit 59825b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default function BreadcrumbItem(localProps: BreadcrumbItemProps) {
<li
className="dnb-breadcrumb__item"
data-testid="breadcrumb-item"
aria-current={variant === 'current' ? true : undefined}
aria-current={variant === 'current' ? 'page' : undefined}
>
{isInteractive ? (
<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('Breadcrumb', () => {
).toBe('Page 2')
})

it('current will have aria-current="true', () => {
it('current item will have aria-current="page', () => {
render(
<Breadcrumb
data={[
Expand All @@ -106,7 +106,7 @@ describe('Breadcrumb', () => {
)

const lastElem = screen.getAllByTestId('breadcrumb-item').slice(-1)[0]
expect(lastElem.getAttribute('aria-current')).toBe('true')
expect(lastElem.getAttribute('aria-current')).toBe('page')
})

it('variant collapse opens the collapsed content on click', () => {
Expand Down

0 comments on commit 59825b8

Please sign in to comment.