2021-12-30 15:46:12 +00:00
|
|
|
import { render } from '@/react-tools/test-utils';
|
|
|
|
|
|
|
|
import { Breadcrumbs } from './Breadcrumbs';
|
|
|
|
|
|
|
|
test('should display a Breadcrumbs, breadcrumbs should be separated by >', async () => {
|
|
|
|
const breadcrumbs = [
|
|
|
|
{ label: 'bread1' },
|
|
|
|
{ label: 'bread2' },
|
|
|
|
{ label: 'bread3' },
|
|
|
|
];
|
2022-08-12 03:47:56 +00:00
|
|
|
const { container } = render(<Breadcrumbs breadcrumbs={breadcrumbs} />);
|
2021-12-30 15:46:12 +00:00
|
|
|
|
2022-08-12 03:47:56 +00:00
|
|
|
expect(container.firstChild?.textContent).toEqual(
|
|
|
|
breadcrumbs.map((b) => b.label).join('>')
|
|
|
|
);
|
2021-12-30 15:46:12 +00:00
|
|
|
});
|