diff --git a/components/breadcrumb/Breadcrumb.tsx b/components/breadcrumb/Breadcrumb.tsx index c5f35ba3f0..8c3068aa6a 100755 --- a/components/breadcrumb/Breadcrumb.tsx +++ b/components/breadcrumb/Breadcrumb.tsx @@ -143,9 +143,11 @@ const Breadcrumb: BreadcrumbInterface = ({ ); return ( -
- {crumbs} -
+ ); }; diff --git a/components/breadcrumb/BreadcrumbItem.tsx b/components/breadcrumb/BreadcrumbItem.tsx index 860971e847..9d3cf25980 100644 --- a/components/breadcrumb/BreadcrumbItem.tsx +++ b/components/breadcrumb/BreadcrumbItem.tsx @@ -30,7 +30,7 @@ const BreadcrumbItem: BreadcrumbItemInterface = ({ const renderBreadcrumbNode = (breadcrumbItem: React.ReactNode) => { if (overlay) { return ( - + {breadcrumbItem} @@ -60,10 +60,12 @@ const BreadcrumbItem: BreadcrumbItemInterface = ({ link = renderBreadcrumbNode(link); if (children) { return ( - +
  • {link} - {separator && {separator}} - + {separator && ( + {separator} + )} +
  • ); } return null; diff --git a/components/breadcrumb/__tests__/Breadcrumb.test.js b/components/breadcrumb/__tests__/Breadcrumb.test.js index 76f78ef7e3..dfc7e84c35 100644 --- a/components/breadcrumb/__tests__/Breadcrumb.test.js +++ b/components/breadcrumb/__tests__/Breadcrumb.test.js @@ -3,10 +3,12 @@ import { mount, render } from 'enzyme'; import Breadcrumb from '../index'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; +import accessibilityTest from "../../../tests/shared/accessibilityTest"; describe('Breadcrumb', () => { mountTest(Breadcrumb); rtlTest(Breadcrumb); + accessibilityTest(Breadcrumb) const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); diff --git a/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap b/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap index 68dd088f3a..af7651be21 100644 --- a/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap +++ b/components/breadcrumb/__tests__/__snapshots__/Breadcrumb.test.js.snap @@ -1,307 +1,325 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Breadcrumb filter React.Fragment 1`] = ` -
    - +
      +
    1. + + Location + +
    2. - Location + : - - - : - - - + + Application Center + + + - Application Center - - - - / - -
    + / +
    + + `; exports[`Breadcrumb rtl render component should be rendered correctly in RTL direction 1`] = ` -
    +> +
      + `; exports[`Breadcrumb should accept undefined routes 1`] = ` -
      +> +
        + `; exports[`Breadcrumb should allow Breadcrumb.Item is null or undefined 1`] = ` -
        - - - Home - - - / - - -
        -`; - -exports[`Breadcrumb should not display Breadcrumb Item when its children is falsy 1`] = ` -
        - - - xxx - - - / - - - - - yyy - - - / - - -
        -`; - -exports[`Breadcrumb should render a menu 1`] = ` -
        - - - - home - - - - / - - - - +
          +
        1. - - first - - - - - - - - / - - - - - - second - - - - / - - - - - - - - / - - -
        -`; - -exports[`Breadcrumb should support Breadcrumb.Item default separator 1`] = ` -
        - - - Location - - - / - - - - - - Mock Node + Home / + +
      + +`; + +exports[`Breadcrumb should not display Breadcrumb Item when its children is falsy 1`] = ` + +`; + +exports[`Breadcrumb should render a menu 1`] = ` + +`; + +exports[`Breadcrumb should support Breadcrumb.Item default separator 1`] = ` +
      +
    1. + + Application Center + + + / + +
    2. +
    + `; exports[`Breadcrumb should support React.Fragment and falsy children 1`] = ` -
    - - - yyy - - - / - - - - - yyy - - - / - - - - - yyy - - - / - - - 0 -
    +
      +
    1. + + yyy + + + / + +
    2. +
    3. + + yyy + + + / + +
    4. +
    5. + + yyy + + + / + +
    6. + 0 +
    + `; exports[`Breadcrumb should support custom attribute 1`] = ` -
    - - - xxx - - - / - - - - - yyy - - - / - - -
    +
      +
    1. + + xxx + + + / + +
    2. +
    3. + + yyy + + + / + +
    4. +
    + `; diff --git a/components/breadcrumb/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/breadcrumb/__tests__/__snapshots__/demo-extend.test.ts.snap index ad5b0456ca..8ecf43f50c 100644 --- a/components/breadcrumb/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/breadcrumb/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -1,545 +1,555 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders ./components/breadcrumb/demo/basic.md extend context correctly 1`] = ` -
    - - - Home - - - / - - - - - +
  • + - Application Center - - - - / - - - - - + - Application List - - - - / - - - - - An Application - - - / - - -
  • -`; - -exports[`renders ./components/breadcrumb/demo/overlay.md extend context correctly 1`] = ` -
    - - - Ant Design - - - / - - - - - - Component - - - - / - - - - + / + + +
  • - General + Application Center - + / - -
    -
    +
  • + - + + + + +
  • +
    - + +
    + -
    -
    -
    -