From de7a9ba3302cc76ac28768455deee4f01aba2296 Mon Sep 17 00:00:00 2001 From: Arya Emami Date: Wed, 4 Sep 2024 23:56:48 -0500 Subject: [PATCH] Fix the snapshots --- ...rializableStateInvariantMiddleware.test.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/toolkit/src/tests/serializableStateInvariantMiddleware.test.ts b/packages/toolkit/src/tests/serializableStateInvariantMiddleware.test.ts index 6e7623fff2..29a9a58d4a 100644 --- a/packages/toolkit/src/tests/serializableStateInvariantMiddleware.test.ts +++ b/packages/toolkit/src/tests/serializableStateInvariantMiddleware.test.ts @@ -114,12 +114,12 @@ describe('serializableStateInvariantMiddleware', () => { store.dispatch(dispatchedAction) expect(getLog().log).toMatchInlineSnapshot(` - "A non-serializable value was detected in an action, in the path: \`payload\`. Value: Symbol(SOME_CONSTANT) + "A non-serializable value was detected in an action, in the path: \`payload\`. Value: Symbol(SOME_CONSTANT) Take a look at the logic that dispatched this action: Object { "payload": Symbol(SOME_CONSTANT), "type": "an-action", - } - (See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants) + } + (See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants) (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)" `) }) @@ -158,7 +158,7 @@ describe('serializableStateInvariantMiddleware', () => { store.dispatch({ type: ACTION_TYPE }) expect(getLog().log).toMatchInlineSnapshot(` - "A non-serializable value was detected in the state, in the path: \`testSlice.a\`. Value: Map {} + "A non-serializable value was detected in the state, in the path: \`testSlice.a\`. Value: Map {} Take a look at the reducer(s) handling this action type: TEST_ACTION. (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)" `) @@ -219,7 +219,7 @@ describe('serializableStateInvariantMiddleware', () => { // since default options are used, the `entries` function in `serializableObject` will cause the error expect(getLog().log).toMatchInlineSnapshot(` - "A non-serializable value was detected in the state, in the path: \`testSlice.a.entries\`. Value: [Function entries] + "A non-serializable value was detected in the state, in the path: \`testSlice.a.entries\`. Value: [Function entries] Take a look at the reducer(s) handling this action type: TEST_ACTION. (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)" `) @@ -266,7 +266,7 @@ describe('serializableStateInvariantMiddleware', () => { // error reported is from a nested class instance, rather than the `entries` function `serializableObject` expect(getLog().log).toMatchInlineSnapshot(` - "A non-serializable value was detected in the state, in the path: \`testSlice.a.third.bad-map-instance\`. Value: Map {} + "A non-serializable value was detected in the state, in the path: \`testSlice.a.third.bad-map-instance\`. Value: Map {} Take a look at the reducer(s) handling this action type: TEST_ACTION. (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)" `) @@ -371,14 +371,14 @@ describe('serializableStateInvariantMiddleware', () => { }).dispatch({ type: 'test', meta: { arg: nonSerializableValue } }) expect(getLog().log).toMatchInlineSnapshot(` - "A non-serializable value was detected in an action, in the path: \`meta.arg\`. Value: Map {} + "A non-serializable value was detected in an action, in the path: \`meta.arg\`. Value: Map {} Take a look at the logic that dispatched this action: Object { "meta": Object { "arg": Map {}, }, "type": "test", - } - (See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants) + } + (See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants) (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)" `) }) @@ -503,7 +503,7 @@ describe('serializableStateInvariantMiddleware', () => { // testSlice.b.d was not covered in ignoredPaths, so will still log the error expect(getLog().log).toMatchInlineSnapshot(` - "A non-serializable value was detected in the state, in the path: \`testSlice.b.d\`. Value: Map {} + "A non-serializable value was detected in the state, in the path: \`testSlice.b.d\`. Value: Map {} Take a look at the reducer(s) handling this action type: TEST_ACTION. (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)" `)