@wordpress/element 4.17.0 → 4.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 4.19.0 (2022-11-02)
6
+
7
+ ## 4.18.0 (2022-10-19)
8
+
5
9
  ## 4.17.0 (2022-10-05)
6
10
 
7
11
  ## 4.16.0 (2022-09-21)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/element",
3
- "version": "4.17.0",
3
+ "version": "4.19.0",
4
4
  "description": "Element React module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,7 +31,7 @@
31
31
  "@babel/runtime": "^7.16.0",
32
32
  "@types/react": "^17.0.37",
33
33
  "@types/react-dom": "^17.0.11",
34
- "@wordpress/escape-html": "^2.19.0",
34
+ "@wordpress/escape-html": "^2.21.0",
35
35
  "change-case": "^4.1.2",
36
36
  "is-plain-object": "^5.0.0",
37
37
  "react": "^17.0.2",
@@ -40,5 +40,5 @@
40
40
  "publishConfig": {
41
41
  "access": "public"
42
42
  },
43
- "gitHead": "8d42d2febb7d0ba8372a33e560a62f5a5f6a9112"
43
+ "gitHead": "511f4cc1f0138641bc4394bc1cf36e833109c791"
44
44
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import TestRenderer, { act } from 'react-test-renderer';
4
+ import { render } from '@testing-library/react';
5
5
 
6
6
  /**
7
7
  * Internal dependencies
@@ -207,19 +207,17 @@ describe( 'createInterpolateElement', () => {
207
207
  </div>
208
208
  );
209
209
  };
210
- let renderer;
211
- act( () => {
212
- renderer = TestRenderer.create(
213
- <TestComponent switchKey={ true } />
214
- );
215
- } );
216
- expect( () => renderer.root.findByType( 'em' ) ).not.toThrow();
217
- expect( () => renderer.root.findByType( 'strong' ) ).toThrow();
218
- act( () => {
219
- renderer.update( <TestComponent switchKey={ false } /> );
220
- } );
221
- expect( () => renderer.root.findByType( 'strong' ) ).not.toThrow();
222
- expect( () => renderer.root.findByType( 'em' ) ).toThrow();
210
+ const { container, rerender } = render( <TestComponent switchKey /> );
211
+
212
+ expect( container.firstChild ).toContainHTML( '<em>string!</em>' );
213
+ expect( container.firstChild ).not.toContainHTML( '<strong>' );
214
+
215
+ rerender( <TestComponent switchKey={ false } /> );
216
+
217
+ expect( container.firstChild ).toContainHTML(
218
+ '<strong>string!</strong>'
219
+ );
220
+ expect( container.firstChild ).not.toContainHTML( '<em>' );
223
221
  } );
224
222
  it( 'handles parsing emojii correctly', () => {
225
223
  const testString = '👳‍♀️<icon>🚨🤷‍♂️⛈️fully</icon> here';
package/src/test/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ /* eslint-disable testing-library/render-result-naming-convention */
2
+
1
3
  /**
2
4
  * Internal dependencies
3
5
  */
@@ -127,3 +129,5 @@ describe( 'element', () => {
127
129
  } );
128
130
  } );
129
131
  } );
132
+
133
+ /* eslint-enable testing-library/render-result-naming-convention */
@@ -1,3 +1,5 @@
1
+ /* eslint-disable testing-library/render-result-naming-convention */
2
+
1
3
  /**
2
4
  * Internal dependencies
3
5
  */
@@ -717,3 +719,5 @@ describe( 'renderStyle()', () => {
717
719
  } );
718
720
  } );
719
721
  } );
722
+
723
+ /* eslint-enable testing-library/render-result-naming-convention */