Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix breadcrumb separator #25984

Merged
merged 3 commits into from Aug 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/breadcrumb/BreadcrumbItem.tsx
Expand Up @@ -17,7 +17,7 @@ interface BreadcrumbItemInterface extends React.FC<BreadcrumbItemProps> {
}
const BreadcrumbItem: BreadcrumbItemInterface = ({
prefixCls: customizePrefixCls,
separator,
separator = '/',
children,
overlay,
dropdownProps,
Expand Down
19 changes: 19 additions & 0 deletions components/breadcrumb/__tests__/Breadcrumb.test.js
Expand Up @@ -138,4 +138,23 @@ describe('Breadcrumb', () => {
);
expect(wrapper).toMatchSnapshot();
});

// https://github.com/ant-design/ant-design/issues/25975
it('should support Breadcrumb.Item default separator', () => {
const MockComponent = () => {
return (
<span>
<Breadcrumb.Item>Mock Node</Breadcrumb.Item>
</span>
);
};
const wrapper = render(
<Breadcrumb>
<Breadcrumb.Item>Location</Breadcrumb.Item>
<MockComponent />
<Breadcrumb.Item>Application Center</Breadcrumb.Item>
</Breadcrumb>,
);
expect(wrapper).toMatchSnapshot();
});
});
Expand Up @@ -185,6 +185,51 @@ exports[`Breadcrumb should render a menu 1`] = `
</div>
`;

exports[`Breadcrumb should support Breadcrumb.Item default separator 1`] = `
<div
class="ant-breadcrumb"
>
<span>
<span
class="ant-breadcrumb-link"
>
Location
</span>
<span
class="ant-breadcrumb-separator"
>
/
</span>
</span>
<span>
<span>
<span
class="ant-breadcrumb-link"
>
Mock Node
</span>
<span
class="ant-breadcrumb-separator"
>
/
</span>
</span>
</span>
<span>
<span
class="ant-breadcrumb-link"
>
Application Center
</span>
<span
class="ant-breadcrumb-separator"
>
/
</span>
</span>
</div>
`;

exports[`Breadcrumb should support React.Fragment and falsy children 1`] = `
<div
class="ant-breadcrumb"
Expand Down