import reducer from "../../../store/reducers/candidates/initProcessReducer"; import expect from "expect"; import { fetchInitProcessSuccess, fetchInitProcessError, } from "../../../store/actions/candidates/candidatesActions"; describe("initProcces reducer", () => { it("should return the initial state", () => { expect(reducer(undefined, {})).toEqual({ isSuccess: false, errorMessage: "", }); }); it("should set the state error", () => { expect(reducer(undefined, fetchInitProcessError("Error"))).toEqual({ isSuccess: false, errorMessage: "Error", }); }); it("should set the state success", () => { expect(reducer(undefined, fetchInitProcessSuccess())).toEqual({ isSuccess: true, errorMessage: "", }); }); });