@elementor/store 0.2.0 → 0.3.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 +15 -0
- package/package.json +3 -3
- package/src/__tests__/store.test.tsx +5 -8
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
# 0.3.0 (2023-06-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add support for React 18 [ED-10905] ([#46](https://github.com/elementor/elementor-packages/issues/46)) ([c8915c6](https://github.com/elementor/elementor-packages/commit/c8915c6ea62550bcdeb5c8a576f311bedc35bcad))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# 0.2.0 (2023-05-09)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elementor/store",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Elementor Team",
|
|
6
6
|
"homepage": "https://elementor.com/",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"dev": "tsup --config=../../tsup.dev.ts"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"react": "17.x"
|
|
35
|
+
"react": "17.x || 18.x"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@reduxjs/toolkit": "^1.9.1",
|
|
39
39
|
"react-redux": "^8.0.5"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "2ee431a07ec6af6ca2b9930c0b830e78696b194a"
|
|
42
42
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
import { renderHook } from '@testing-library/react';
|
|
3
4
|
import {
|
|
4
5
|
createStore,
|
|
5
6
|
getStore,
|
|
@@ -39,7 +40,7 @@ const createStoreEntities = ( { initialValue = 1 }: Config = {} ) => {
|
|
|
39
40
|
|
|
40
41
|
const store = createStore();
|
|
41
42
|
|
|
42
|
-
const wrapper
|
|
43
|
+
const wrapper = ( { children }: PropsWithChildren ) => (
|
|
43
44
|
<StoreProvider store={ store }>
|
|
44
45
|
{ children }
|
|
45
46
|
</StoreProvider>
|
|
@@ -223,9 +224,6 @@ describe( '@elementor/store', () => {
|
|
|
223
224
|
|
|
224
225
|
it( 'should delete the added slices', () => {
|
|
225
226
|
// Arrange.
|
|
226
|
-
// Redux sends an error to the console when trying to create a store without slices.
|
|
227
|
-
const spyOnConsoleError = jest.spyOn( console, 'error' ).mockReturnValue( undefined );
|
|
228
|
-
|
|
229
227
|
createStoreEntities();
|
|
230
228
|
|
|
231
229
|
// Act.
|
|
@@ -234,7 +232,7 @@ describe( '@elementor/store', () => {
|
|
|
234
232
|
// Arrange.
|
|
235
233
|
const store = createStore();
|
|
236
234
|
|
|
237
|
-
const wrapper
|
|
235
|
+
const wrapper = ( { children }: PropsWithChildren ) => (
|
|
238
236
|
<StoreProvider store={ store }>
|
|
239
237
|
{ children }
|
|
240
238
|
</StoreProvider>
|
|
@@ -244,8 +242,7 @@ describe( '@elementor/store', () => {
|
|
|
244
242
|
|
|
245
243
|
// Assert.
|
|
246
244
|
expect( result.current ).toBeUndefined();
|
|
247
|
-
|
|
248
|
-
expect( spyOnConsoleError ).toHaveBeenCalled();
|
|
245
|
+
expect( console ).toHaveErrored();
|
|
249
246
|
} );
|
|
250
247
|
|
|
251
248
|
it( 'should delete the added middlewares', () => {
|