@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 +4 -0
- package/package.json +3 -3
- package/src/test/create-interpolate-element.js +12 -14
- package/src/test/index.js +4 -0
- package/src/test/serialize.js +4 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/element",
|
|
3
|
-
"version": "4.
|
|
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.
|
|
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": "
|
|
43
|
+
"gitHead": "511f4cc1f0138641bc4394bc1cf36e833109c791"
|
|
44
44
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
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
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
} );
|
|
216
|
-
|
|
217
|
-
expect(
|
|
218
|
-
|
|
219
|
-
|
|
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 */
|
package/src/test/serialize.js
CHANGED
|
@@ -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 */
|