// #region Global Imports import configureMockStore from "redux-mock-store"; import thunk from "redux-thunk"; // #endregion Global Imports // #region Local Imports import { {{fileName}}Actions } from "./"; import { ActionConsts } from "@Definitions"; // #endregion Local Imports const middlewares = [thunk]; const mockStore = configureMockStore(middlewares); describe("{{fileName}} action tests", () => { test("Map test", () => { const store = mockStore(); const expectedActions = [ { payload: { version: 2 }, type: ActionConsts.{{fileName}}.SetReducer }, ]; store.dispatch({{fileName}}Actions.Map({ version: 2 })); expect(store.getActions()).toEqual(expectedActions); }); test("Reset test", async () => { const store = mockStore({ {{lowerFileName}}: { version: 1 }, }); const expectedActions = [ { type: ActionConsts.{{fileName}}.ResetReducer }, ]; store.dispatch({{fileName}}Actions.Reset()); expect(store.getActions()).toEqual(expectedActions); }); });