diff --git a/plugins/woocommerce-admin/packages/components/src/animation-slider/test/__snapshots__/index.js.snap b/plugins/woocommerce-admin/packages/components/src/animation-slider/test/__snapshots__/index.js.snap index 96fe83cf4fb..20723f466c2 100644 --- a/plugins/woocommerce-admin/packages/components/src/animation-slider/test/__snapshots__/index.js.snap +++ b/plugins/woocommerce-admin/packages/components/src/animation-slider/test/__snapshots__/index.js.snap @@ -1,11 +1,78 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`AnimationSlider it renders correctly 1`] = ` -
-
-
-
-
+Object { + "asFragment": [Function], + "baseElement": +
+
+
+
+
+
+
+ , + "container":
+
+
+
+
+
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/plugins/woocommerce-admin/packages/components/src/animation-slider/test/index.js b/plugins/woocommerce-admin/packages/components/src/animation-slider/test/index.js index 4c8fe1f71cf..83d224f34c9 100644 --- a/plugins/woocommerce-admin/packages/components/src/animation-slider/test/index.js +++ b/plugins/woocommerce-admin/packages/components/src/animation-slider/test/index.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import renderer from 'react-test-renderer'; +import { render } from '@testing-library/react'; import { createElement } from '@wordpress/element'; /** @@ -11,13 +11,11 @@ import AnimationSlider from '../'; describe( 'AnimationSlider', () => { test( 'it renders correctly', () => { - const tree = renderer - .create( - - { () =>
} - - ) - .toJSON(); - expect( tree ).toMatchSnapshot(); + const component = render( + + { () =>
} + + ); + expect( component ).toMatchSnapshot(); } ); } ); diff --git a/plugins/woocommerce-admin/packages/components/src/dropdown-button/test/__snapshots__/index.js.snap b/plugins/woocommerce-admin/packages/components/src/dropdown-button/test/__snapshots__/index.js.snap index dc70375924e..79f6f9aa533 100644 --- a/plugins/woocommerce-admin/packages/components/src/dropdown-button/test/__snapshots__/index.js.snap +++ b/plugins/woocommerce-admin/packages/components/src/dropdown-button/test/__snapshots__/index.js.snap @@ -1,16 +1,112 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`DropdownButton it renders correctly 1`] = ` - +Object { + "asFragment": [Function], + "baseElement": + +
+
+
+ +
+ , + "container":
+ +
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/plugins/woocommerce-admin/packages/components/src/dropdown-button/test/index.js b/plugins/woocommerce-admin/packages/components/src/dropdown-button/test/index.js index 0a4bc1f4d9b..52e7518cd9f 100644 --- a/plugins/woocommerce-admin/packages/components/src/dropdown-button/test/index.js +++ b/plugins/woocommerce-admin/packages/components/src/dropdown-button/test/index.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import renderer from 'react-test-renderer'; +import { render } from '@testing-library/react'; import { createElement } from '@wordpress/element'; /** @@ -11,9 +11,7 @@ import DropdownButton from '../'; describe( 'DropdownButton', () => { test( 'it renders correctly', () => { - const tree = renderer - .create( ) - .toJSON(); - expect( tree ).toMatchSnapshot(); + const component = render( ); + expect( component ).toMatchSnapshot(); } ); } ); diff --git a/plugins/woocommerce-admin/packages/components/src/search-list-control/test/__snapshots__/index.js.snap b/plugins/woocommerce-admin/packages/components/src/search-list-control/test/__snapshots__/index.js.snap index 89414f396af..7e66dc7d605 100644 --- a/plugins/woocommerce-admin/packages/components/src/search-list-control/test/__snapshots__/index.js.snap +++ b/plugins/woocommerce-admin/packages/components/src/search-list-control/test/__snapshots__/index.js.snap @@ -1,1736 +1,4272 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`SearchListControl should render a search box and list of hierarchical options 1`] = ` -
-
-
+
-
-
+ Notifications +

+ aria-atomic="true" + aria-live="assertive" + aria-relevant="additions text" + class="a11y-speak-region" + id="a11y-speak-assertive" + style="position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;" + /> +
+
- - +
+ + 0 items selected + +
+
+ +
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
-
-
    -
  • -
  • -
  • -
+
+ +
+
+
    - - - + - + + + Apricots + + + + +
  • + -
  • -
  • - +
  • +
  • + +
  • +
  • + -
  • -
  • - +
  • +
  • + -
  • -
  • - +
  • +
  • + -
  • -
-
+ + + + Mulberry + + + + + +
+
, + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`SearchListControl should render a search box and list of options 1`] = ` -
-
-
+
-
-
+ Notifications +

+ aria-atomic="true" + aria-live="assertive" + aria-relevant="additions text" + class="a11y-speak-region" + id="a11y-speak-assertive" + style="position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;" + /> +
+
- - +
+ + 0 items selected + +
+
+ +
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
-
-
    -
  • -
  • -
  • -
+
+ +
+
+ - + + + + Guava + + + + +
  • + +
  • +
  • + +
  • + + + , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`SearchListControl should render a search box and list of options with a custom className 1`] = ` -
    -
    -
    +
    -
    -
    + Notifications +

    + aria-atomic="true" + aria-live="assertive" + aria-relevant="additions text" + class="a11y-speak-region" + id="a11y-speak-assertive" + style="position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;" + /> +
    +
    + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    -
    -
    +
    + + + + - + + + + Guava + + + + +
  • + +
  • +
  • + +
  • + + + , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`SearchListControl should render a search box and list of options, with a custom render callback for each item 1`] = ` -
    -
    -
    +
    -
    -
    + Notifications +

    +
    +
    +
    +
    +
    + + 0 items selected + +
    +
    + +
      +
    • +
      + Apricots + ! +
      +
    • +
    • +
      + Clementine + ! +
      +
    • +
    • +
      + Elderberry + ! +
      +
    • +
    • +
      + Guava + ! +
      +
    • +
    • +
      + Lychee + ! +
      +
    • +
    • +
      + Mulberry + ! +
      +
    • +
    +
    +
    + , + "container":
    +
    - - + + 0 items selected + +
    + +
      +
    • +
      + Apricots + ! +
      +
    • +
    • +
      + Clementine + ! +
      +
    • +
    • +
      + Elderberry + ! +
      +
    • +
    • +
      + Guava + ! +
      +
    • +
    • +
      + Lychee + ! +
      +
    • +
    • +
      + Mulberry + ! +
      +
    • +
    -
    -
      -
    • -
      - Apricots - ! -
      -
    • -
    • -
      - Clementine - ! -
      -
    • -
    • -
      - Elderberry - ! -
      -
    • -
    • -
      - Guava - ! -
      -
    • -
    • -
      - Lychee - ! -
      -
    • -
    • -
      - Mulberry - ! -
      -
    • -
    -
    +
    , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`SearchListControl should render a search box and list of options, with a custom search input message 1`] = ` -
    -
    -
    +
    -
    -
    + Notifications +

    + aria-atomic="true" + aria-live="assertive" + aria-relevant="additions text" + class="a11y-speak-region" + id="a11y-speak-assertive" + style="position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;" + /> +
    +
    - - +
    + + 0 items selected + +
    +
    + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    -
    -
      -
    • -
    • -
    • -
    +
    + +
    + + - + + + + Guava + + + + +
  • + +
  • +
  • + +
  • + + + , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`SearchListControl should render a search box and no options 1`] = ` -
    -
    -
    +
    -
    -
    + Notifications +

    + aria-atomic="true" + aria-live="assertive" + aria-relevant="additions text" + class="a11y-speak-region" + id="a11y-speak-assertive" + style="position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;" + /> +
    +
    - - +
    + + 0 items selected + +
    +
    + +
    + + + + + No items found. + +
    -
    -
    - , + "container":
    +
    - - - - No items found. - -
    -
    +
    + + 0 items selected + +
    +
    + +
    + + + + + No items found. + +
    +
    +
    , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`SearchListControl should render a search box with a search term, and no matching options 1`] = ` -
    -
    -
    +
    -
    -
    + Notifications +

    + aria-atomic="true" + aria-live="assertive" + aria-relevant="additions text" + class="a11y-speak-region" + id="a11y-speak-assertive" + style="position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;" + /> +
    +
    - - +
    + + 0 items selected + +
    +
    + +
    + + + + + No results for no matches + +
    -
    -
    - , + "container":
    +
    - - - - No results for no matches - -
    -
    +
    + + 0 items selected + +
    +
    + +
    + + + + + No results for no matches + +
    +
    +
    , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`SearchListControl should render a search box with a search term, and only matching options 1`] = ` -
    -
    -
    +
    -
    -
    + Notifications +

    + aria-atomic="true" + aria-live="assertive" + aria-relevant="additions text" + class="a11y-speak-region" + id="a11y-speak-assertive" + style="position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;" + /> +
    +
    - - +
    + + 0 items selected + +
    +
    + +
      +
    • + +
    • +
    • + +
    • +
    -
    -
    +
    + + + + + + + + + , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`SearchListControl should render a search box with a search term, and only matching options, regardless of case sensitivity 1`] = ` -
    -
    -
    +
    -
    -
    + Notifications +

    + aria-atomic="true" + aria-live="assertive" + aria-relevant="additions text" + class="a11y-speak-region" + id="a11y-speak-assertive" + style="position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;" + /> +
    +
    - - +
    + + 0 items selected + +
    +
    + +
      +
    • + +
    • +
    • + +
    • +
    -
    -
    +
    + + + + + + + + + , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`SearchListControl should render a search box, a list of options, and 1 selected item 1`] = ` -
    -
    -
    +
    - -
    -
    + Notifications +

    + aria-atomic="true" + aria-live="assertive" + aria-relevant="additions text" + class="a11y-speak-region" + id="a11y-speak-assertive" + style="position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;" + /> +
    +
    - - +
    + + 1 item selected + + +
    +
      +
    • + + + + Clementine + + + + + +
    • +
    +
    + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    -
    -
    + +
    + + + + - + + + + Guava + + + + +
  • + +
  • +
  • + +
  • + + + , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`SearchListControl should render a search box, a list of options, and 2 selected item 1`] = ` -
    -
    -
    +
    - -
    -
    + Notifications +

    + aria-atomic="true" + aria-live="assertive" + aria-relevant="additions text" + class="a11y-speak-region" + id="a11y-speak-assertive" + style="position: absolute;margin: -1px;padding: 0;height: 1px;width: 1px;overflow: hidden;clip: rect(1px, 1px, 1px, 1px);-webkit-clip-path: inset(50%);clip-path: inset(50%);border: 0;word-wrap: normal !important;" + /> +
    +
    - - +
    + + 2 items selected + + +
    +
      +
    • + + + + Clementine + + + + + +
    • +
    • + + + + Guava + + + + + +
    • +
    +
    + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    -
    -
    + +
    + + + + - + + + + Guava + + + + +
  • + +
  • +
  • + +
  • + + + , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/plugins/woocommerce-admin/packages/components/src/search-list-control/test/index.js b/plugins/woocommerce-admin/packages/components/src/search-list-control/test/index.js index 10eeb9e5c6a..39b60d1e949 100644 --- a/plugins/woocommerce-admin/packages/components/src/search-list-control/test/index.js +++ b/plugins/woocommerce-admin/packages/components/src/search-list-control/test/index.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import renderer from 'react-test-renderer'; +import { render } from '@testing-library/react'; import { noop } from 'lodash'; import { createElement } from '@wordpress/element'; @@ -30,7 +30,7 @@ const hierarchicalList = [ describe( 'SearchListControl', () => { test( 'should render a search box and list of options', () => { - const component = renderer.create( + const component = render( { onChange={ noop } /> ); - expect( component.toJSON() ).toMatchSnapshot(); + expect( component ).toMatchSnapshot(); } ); test( 'should render a search box and list of options with a custom className', () => { - const component = renderer.create( + const component = render( { onChange={ noop } /> ); - expect( component.toJSON() ).toMatchSnapshot(); + expect( component ).toMatchSnapshot(); } ); test( 'should render a search box, a list of options, and 1 selected item', () => { - const component = renderer.create( + const component = render( { onChange={ noop } /> ); - expect( component.toJSON() ).toMatchSnapshot(); + expect( component ).toMatchSnapshot(); } ); test( 'should render a search box, a list of options, and 2 selected item', () => { - const component = renderer.create( + const component = render( { onChange={ noop } /> ); - expect( component.toJSON() ).toMatchSnapshot(); + expect( component ).toMatchSnapshot(); } ); test( 'should render a search box and no options', () => { - const component = renderer.create( + const component = render( { onChange={ noop } /> ); - expect( component.toJSON() ).toMatchSnapshot(); + expect( component ).toMatchSnapshot(); } ); test( 'should render a search box with a search term, and only matching options', () => { - const component = renderer.create( + const component = render( { debouncedSpeak={ noop } /> ); - expect( component.toJSON() ).toMatchSnapshot(); + expect( component ).toMatchSnapshot(); } ); test( 'should render a search box with a search term, and only matching options, regardless of case sensitivity', () => { - const component = renderer.create( + const component = render( { debouncedSpeak={ noop } /> ); - expect( component.toJSON() ).toMatchSnapshot(); + expect( component ).toMatchSnapshot(); } ); test( 'should render a search box with a search term, and no matching options', () => { - const component = renderer.create( + const component = render( { debouncedSpeak={ noop } /> ); - expect( component.toJSON() ).toMatchSnapshot(); + expect( component ).toMatchSnapshot(); } ); test( 'should render a search box and list of options, with a custom search input message', () => { const messages = { search: 'Testing search label' }; - const component = renderer.create( + const component = render( { messages={ messages } /> ); - expect( component.toJSON() ).toMatchSnapshot(); + expect( component ).toMatchSnapshot(); } ); test( 'should render a search box and list of options, with a custom render callback for each item', () => { const renderItem = ( { item } ) => (
    { item.name }!
    ); // eslint-disable-line - const component = renderer.create( + const component = render( { renderItem={ renderItem } /> ); - expect( component.toJSON() ).toMatchSnapshot(); + expect( component ).toMatchSnapshot(); } ); test( 'should render a search box and list of hierarchical options', () => { - const component = renderer.create( + const component = render( { isHierarchical /> ); - expect( component.toJSON() ).toMatchSnapshot(); + expect( component ).toMatchSnapshot(); } ); } ); diff --git a/plugins/woocommerce-admin/packages/components/src/section-header/test/__snapshots__/index.js.snap b/plugins/woocommerce-admin/packages/components/src/section-header/test/__snapshots__/index.js.snap index a11756e912d..2989e1da556 100644 --- a/plugins/woocommerce-admin/packages/components/src/section-header/test/__snapshots__/index.js.snap +++ b/plugins/woocommerce-admin/packages/components/src/section-header/test/__snapshots__/index.js.snap @@ -1,16 +1,112 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`SectionHeader it renders correctly 1`] = ` -
    -

    - A SectionHeader Example -

    -
    -
    +Object { + "asFragment": [Function], + "baseElement": + +
    +
    +
    +
    +

    + A SectionHeader Example +

    +
    +
    +
    + , + "container":
    +
    +

    + A SectionHeader Example +

    +
    +
    +
    , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/plugins/woocommerce-admin/packages/components/src/section-header/test/index.js b/plugins/woocommerce-admin/packages/components/src/section-header/test/index.js index 8404f42be6e..5034677e27d 100644 --- a/plugins/woocommerce-admin/packages/components/src/section-header/test/index.js +++ b/plugins/woocommerce-admin/packages/components/src/section-header/test/index.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import renderer from 'react-test-renderer'; +import { render } from '@testing-library/react'; import { createElement } from '@wordpress/element'; /** @@ -16,9 +16,9 @@ describe( 'SectionHeader', () => { } ); test( 'it renders correctly', () => { - const tree = renderer - .create( ) - .toJSON(); - expect( tree ).toMatchSnapshot(); + const component = render( + + ); + expect( component ).toMatchSnapshot(); } ); } ); diff --git a/plugins/woocommerce-admin/packages/components/src/tag/test/__snapshots__/index.js.snap b/plugins/woocommerce-admin/packages/components/src/tag/test/__snapshots__/index.js.snap index a1350f98951..35098b6833e 100644 --- a/plugins/woocommerce-admin/packages/components/src/tag/test/__snapshots__/index.js.snap +++ b/plugins/woocommerce-admin/packages/components/src/tag/test/__snapshots__/index.js.snap @@ -1,112 +1,545 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Tag should render a tag with the label foo 1`] = ` - - - + +
    +
    +
    + + + + foo + + + + +
    + , + "container":
    - - +
    , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`Tag This is a popover

    } /> should render a tag with a popover 1`] = ` - - + +
    + , + "container":
    - - +
    , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`Tag should render a tag with a close button 1`] = ` - - +Object { + "asFragment": [Function], + "baseElement": + +
    +
    +
    + + + + foo + + + + + +
    + , + "container":
    - foo + + + foo + + + + - - - - +
    , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; exports[`Tag should render a tag with a screen reader label 1`] = ` - - - + +
    +
    +
    + + + + FooBar + + + + +
    + , + "container":
    - - +
    , + "debug": [Function], + "findAllByAltText": [Function], + "findAllByDisplayValue": [Function], + "findAllByLabelText": [Function], + "findAllByPlaceholderText": [Function], + "findAllByRole": [Function], + "findAllByTestId": [Function], + "findAllByText": [Function], + "findAllByTitle": [Function], + "findByAltText": [Function], + "findByDisplayValue": [Function], + "findByLabelText": [Function], + "findByPlaceholderText": [Function], + "findByRole": [Function], + "findByTestId": [Function], + "findByText": [Function], + "findByTitle": [Function], + "getAllByAltText": [Function], + "getAllByDisplayValue": [Function], + "getAllByLabelText": [Function], + "getAllByPlaceholderText": [Function], + "getAllByRole": [Function], + "getAllByTestId": [Function], + "getAllByText": [Function], + "getAllByTitle": [Function], + "getByAltText": [Function], + "getByDisplayValue": [Function], + "getByLabelText": [Function], + "getByPlaceholderText": [Function], + "getByRole": [Function], + "getByTestId": [Function], + "getByText": [Function], + "getByTitle": [Function], + "queryAllByAltText": [Function], + "queryAllByDisplayValue": [Function], + "queryAllByLabelText": [Function], + "queryAllByPlaceholderText": [Function], + "queryAllByRole": [Function], + "queryAllByTestId": [Function], + "queryAllByText": [Function], + "queryAllByTitle": [Function], + "queryByAltText": [Function], + "queryByDisplayValue": [Function], + "queryByLabelText": [Function], + "queryByPlaceholderText": [Function], + "queryByRole": [Function], + "queryByTestId": [Function], + "queryByText": [Function], + "queryByTitle": [Function], + "rerender": [Function], + "unmount": [Function], +} `; diff --git a/plugins/woocommerce-admin/packages/components/src/tag/test/index.js b/plugins/woocommerce-admin/packages/components/src/tag/test/index.js index 424fa319e39..11588ea0478 100644 --- a/plugins/woocommerce-admin/packages/components/src/tag/test/index.js +++ b/plugins/woocommerce-admin/packages/components/src/tag/test/index.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import renderer from 'react-test-renderer'; +import { render } from '@testing-library/react'; import { createElement } from '@wordpress/element'; /** @@ -13,30 +13,26 @@ const noop = () => {}; describe( 'Tag', () => { test( ' should render a tag with the label foo', () => { - const tree = renderer.create( ).toJSON(); - expect( tree ).toMatchSnapshot(); + const component = render( ); + expect( component ).toMatchSnapshot(); } ); test( ' should render a tag with a close button', () => { - const tree = renderer - .create( ) - .toJSON(); - expect( tree ).toMatchSnapshot(); + const component = render( ); + expect( component ).toMatchSnapshot(); } ); test( 'This is a popover

    } /> should render a tag with a popover', () => { - const tree = renderer - .create( - This is a popover

    } /> - ) - .toJSON(); - expect( tree ).toMatchSnapshot(); + const component = render( + This is a popover

    } /> + ); + expect( component ).toMatchSnapshot(); } ); test( ' should render a tag with a screen reader label', () => { - const tree = renderer - .create( ) - .toJSON(); - expect( tree ).toMatchSnapshot(); + const component = render( + + ); + expect( component ).toMatchSnapshot(); } ); } );