chore(deps): update dependency @reduxjs/toolkit to v2 (#2369)
* fix(deps): update dependency @reduxjs/toolkit to v2 * chore: minor updates to work with RTK version 2 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Braden MacDonald <braden@opencraft.com>
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
import { AnyAction, configureStore, ThunkMiddleware } from '@reduxjs/toolkit';
|
||||
import { ToolkitStore } from '@reduxjs/toolkit/dist/configureStore';
|
||||
import {
|
||||
configureStore,
|
||||
type EnhancedStore,
|
||||
type StoreEnhancer,
|
||||
type ThunkDispatch,
|
||||
type Tuple,
|
||||
type UnknownAction,
|
||||
} from '@reduxjs/toolkit';
|
||||
import {
|
||||
CourseOptimizerState,
|
||||
reducer,
|
||||
@@ -19,7 +25,9 @@ import {
|
||||
} from './slice';
|
||||
|
||||
describe('courseOptimizer slice', () => {
|
||||
let store: ToolkitStore<CourseOptimizerState, AnyAction, [ThunkMiddleware<CourseOptimizerState, AnyAction>]>;
|
||||
let store: EnhancedStore<CourseOptimizerState, UnknownAction, Tuple<[StoreEnhancer<{
|
||||
dispatch: ThunkDispatch<CourseOptimizerState, undefined, UnknownAction>;
|
||||
}>, StoreEnhancer]>>;
|
||||
|
||||
beforeEach(() => {
|
||||
store = configureStore({ reducer });
|
||||
|
||||
@@ -398,13 +398,7 @@ describe.each([
|
||||
},
|
||||
});
|
||||
|
||||
store = initializeStore({
|
||||
models: {
|
||||
courseDetails: {
|
||||
[courseId]: {},
|
||||
},
|
||||
},
|
||||
});
|
||||
store = initializeStore();
|
||||
axiosMock = new MockAdapter(getAuthenticatedHttpClient());
|
||||
|
||||
axiosMock.onGet(getDiscussionsProvidersUrl(courseId))
|
||||
|
||||
@@ -89,6 +89,6 @@ export default function initializeStore(preloadedState: Partial<DeprecatedReduxS
|
||||
groupConfigurations: groupConfigurationsReducer,
|
||||
textbooks: textbooksReducer,
|
||||
},
|
||||
preloadedState,
|
||||
preloadedState: (preloadedState as DeprecatedReduxState | undefined),
|
||||
});
|
||||
}
|
||||
|
||||
@@ -159,12 +159,12 @@ const defaultUser = {
|
||||
*/
|
||||
export function initializeMocks({ user = defaultUser, initialState = undefined }: {
|
||||
user?: { userId: number, username: string },
|
||||
initialState?: Partial<DeprecatedReduxState>
|
||||
initialState?: Partial<DeprecatedReduxState>,
|
||||
} = {}) {
|
||||
initializeMockApp({
|
||||
authenticatedUser: user,
|
||||
});
|
||||
reduxStore = initializeReduxStore(initialState as any);
|
||||
reduxStore = initializeReduxStore(initialState);
|
||||
queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
|
||||
Reference in New Issue
Block a user