Skip to content

Commit 4b76e93

Browse files
committed
further clarification in test
1 parent df9ece4 commit 4b76e93

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/toolkit/src/tests/createSlice.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,15 @@ describe('createSlice', () => {
625625
).toThrowErrorMatchingInlineSnapshot(
626626
`[Error: selectState returned undefined for an uninjected slice reducer]`
627627
)
628+
629+
const injected2 = slice.injectInto(combinedReducer, {
630+
reducerPath: 'other',
631+
})
632+
633+
// can use same cache for localised selectors
634+
expect(injected.getSelectors()).toBe(injected2.getSelectors())
635+
// these should be different
636+
expect(injected.selectors).not.toBe(injected2.selectors)
628637
})
629638
})
630639
describe('reducers definition with asyncThunks', () => {

0 commit comments

Comments
 (0)