|
@ -100,11 +100,19 @@ describe('Breadcrumb', () => { |
|
|
path: 'second', |
|
|
path: 'second', |
|
|
breadcrumbName: 'second', |
|
|
breadcrumbName: 'second', |
|
|
}, |
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
path: 'third', |
|
|
|
|
|
}, |
|
|
]; |
|
|
]; |
|
|
const wrapper = render(<Breadcrumb routes={routes} />); |
|
|
const wrapper = render(<Breadcrumb routes={routes} />); |
|
|
expect(wrapper).toMatchSnapshot(); |
|
|
expect(wrapper).toMatchSnapshot(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should accept undefined routes', () => { |
|
|
|
|
|
const wrapper = render(<Breadcrumb routes={undefined} />); |
|
|
|
|
|
expect(wrapper).toMatchSnapshot(); |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
it('props#linkRender and props#nameRender do not warn anymore', () => { |
|
|
it('props#linkRender and props#nameRender do not warn anymore', () => { |
|
|
const linkRender = jest.fn(); |
|
|
const linkRender = jest.fn(); |
|
|
const nameRender = jest.fn(); |
|
|
const nameRender = jest.fn(); |
|
@ -129,4 +137,20 @@ describe('Breadcrumb', () => { |
|
|
); |
|
|
); |
|
|
expect(wrapper).toMatchSnapshot(); |
|
|
expect(wrapper).toMatchSnapshot(); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it('should support React.Fragment and falsy children', () => { |
|
|
|
|
|
const wrapper = render( |
|
|
|
|
|
<Breadcrumb> |
|
|
|
|
|
<> |
|
|
|
|
|
<Breadcrumb.Item>yyy</Breadcrumb.Item> |
|
|
|
|
|
<Breadcrumb.Item>yyy</Breadcrumb.Item> |
|
|
|
|
|
</> |
|
|
|
|
|
<Breadcrumb.Item>yyy</Breadcrumb.Item> |
|
|
|
|
|
{0} |
|
|
|
|
|
{null} |
|
|
|
|
|
{undefined} |
|
|
|
|
|
</Breadcrumb>, |
|
|
|
|
|
); |
|
|
|
|
|
expect(wrapper).toMatchSnapshot(); |
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|