ant-design/components/breadcrumb/__tests__/itemRender.test.tsx
二货爱吃白萝卜 78e9d58ef1
fix: Breadcrumb itemRender not remove link even path is provided (#42049)
* refactor: out of bread item render

* refactor: fix too filled

* fix: render logic

* test: add test case

* fix: ts

* fix: test
2023-04-27 22:43:42 +08:00

30 lines
634 B
TypeScript

import React from 'react';
import { render } from '../../../tests/utils';
import Breadcrumb from '../index';
describe('Breadcrumb.ItemRender', () => {
it('render as expect', () => {
const { container } = render(
<Breadcrumb
items={[
{
path: '/',
title: 'Home',
},
{
path: '/bamboo',
title: 'Bamboo',
},
]}
itemRender={(route) => (
<a className="my-link" data-path={route.path}>
{route.title}
</a>
)}
/>,
);
expect(container).toMatchSnapshot();
});
});