Skip to content

Commit

Permalink
add new test
Browse files Browse the repository at this point in the history
when breadcrumb lenght=1, pageHeader should have breadcrumb
  • Loading branch information
chenshuai2144 committed Jun 20, 2019
1 parent ee21b1c commit 7e548e4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions components/page-header/__tests__/index.test.js
Expand Up @@ -21,6 +21,19 @@ describe('PageHeader', () => {
const wrapper = mount(<PageHeader title="Page Title" breadcrumb={{ routes }} />);
expect(wrapper.find('.ant-page-header-back')).toHaveLength(0);
});

it('pageHeader should have breadcrumb', () => {
const routes = [
{
path: 'index',
breadcrumbName: 'First-level Menu',
},
];
const wrapper = mount(<PageHeader title="Page Title" breadcrumb={{ routes }} />);
expect(wrapper.find('.ant-breadcrumb')).toHaveLength(1);
expect(wrapper.find('.ant-page-header-back')).toHaveLength(0);
});

it('pageHeader should no contain back', () => {
const wrapper = mount(<PageHeader title="Page Title" backIcon={false} />);
expect(wrapper.find('.ant-page-header-back')).toHaveLength(0);
Expand Down

0 comments on commit 7e548e4

Please sign in to comment.