Skip to content

Commit

Permalink
further clarification in test
Browse files Browse the repository at this point in the history
  • Loading branch information
EskiMojo14 committed Jan 16, 2024
1 parent df9ece4 commit 4b76e93
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/toolkit/src/tests/createSlice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,15 @@ describe('createSlice', () => {
).toThrowErrorMatchingInlineSnapshot(
`[Error: selectState returned undefined for an uninjected slice reducer]`
)

const injected2 = slice.injectInto(combinedReducer, {
reducerPath: 'other',
})

// can use same cache for localised selectors
expect(injected.getSelectors()).toBe(injected2.getSelectors())
// these should be different
expect(injected.selectors).not.toBe(injected2.selectors)
})
})
describe('reducers definition with asyncThunks', () => {
Expand Down

0 comments on commit 4b76e93

Please sign in to comment.