1
1
import { createReducer } from '../createReducer'
2
2
import { createAction } from '../createAction'
3
3
import { createSlice } from '../createSlice'
4
- import type { WithApi , WithSlice } from '../combineSlices'
4
+ import type { WithSlice } from '../combineSlices'
5
5
import { combineSlices } from '../combineSlices'
6
6
import { expectType } from './helpers'
7
7
import type { CombinedState } from '../query/core/apiState'
@@ -84,19 +84,19 @@ describe('combineSlices', () => {
84
84
combineSlices ( stringSlice ) . withLazyLoadedSlices < { boolean : boolean } > ( )
85
85
86
86
combinedReducer . inject ( {
87
- name : 'boolean' as const ,
87
+ reducerPath : 'boolean' as const ,
88
88
reducer : booleanReducer ,
89
89
} )
90
90
91
91
combinedReducer . inject ( {
92
- name : 'boolean' as const ,
92
+ reducerPath : 'boolean' as const ,
93
93
reducer : booleanReducer ,
94
94
} )
95
95
96
96
expect ( consoleSpy ) . not . toHaveBeenCalled ( )
97
97
98
98
combinedReducer . inject ( {
99
- name : 'boolean' as const ,
99
+ reducerPath : 'boolean' as const ,
100
100
// @ts -expect-error wrong reducer
101
101
reducer : stringSlice . reducer ,
102
102
} )
@@ -110,13 +110,13 @@ describe('combineSlices', () => {
110
110
const consoleSpy = vi . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
111
111
const combinedReducer = combineSlices ( stringSlice ) . withLazyLoadedSlices <
112
112
WithSlice < typeof numberSlice > &
113
- WithApi < typeof api > & { boolean : boolean }
113
+ WithSlice < typeof api > & { boolean : boolean }
114
114
> ( )
115
115
116
116
combinedReducer . inject ( numberSlice )
117
117
118
118
combinedReducer . inject (
119
- { name : 'number' as const , reducer : ( ) => 0 } ,
119
+ { reducerPath : 'number' as const , reducer : ( ) => 0 } ,
120
120
{ overrideExisting : true }
121
121
)
122
122
@@ -130,7 +130,7 @@ describe('combineSlices', () => {
130
130
const uninjectedState = combinedReducer ( undefined , dummyAction ( ) )
131
131
132
132
const injectedReducer = combinedReducer . inject ( {
133
- name : 'boolean' as const ,
133
+ reducerPath : 'boolean' as const ,
134
134
reducer : booleanReducer ,
135
135
} )
136
136
0 commit comments