Skip to content

Commit

Permalink
test(spindle-ui): check aria attributes in Breadcrumb
Browse files Browse the repository at this point in the history
  • Loading branch information
herablog committed Aug 9, 2023
1 parent 5b4a418 commit dfc2d90
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/spindle-ui/src/Breadcrumb/Breadcrumb.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import { render, screen } from '@testing-library/react';

import { BreadcrumbList, BreadcrumbItem } from './';

describe('<Breadcrumb />', () => {
test('having aria attributes', () => {
render(
<BreadcrumbList>
<BreadcrumbItem href="/top">Top</BreadcrumbItem>
<BreadcrumbItem href="/team">Team</BreadcrumbItem>
<BreadcrumbItem href="/about" current>
Amebaとは
</BreadcrumbItem>
</BreadcrumbList>,
);

expect(screen.getByRole('navigation').getAttribute('aria-label')).toEqual(
'パンくずリスト',
);
expect(screen.getByText('Amebaとは').getAttribute('aria-current')).toEqual(
'page',
);
});
});

0 comments on commit dfc2d90

Please sign in to comment.