import reducer from "../../../../store/reducers/processes/interviewerUpdateReducer";
import expect from "expect";
import {
  setUpdateInterviewerSucc,
  setUpdateInterviewerReq,
  setUpdateInterviewerErr
} from "../../../../store/actions/processes/processAction";

describe("interviewerUpdateReducer reducer", () => {
  it("should return the initial state", () => {
    expect(reducer(undefined, {})).toEqual({
      updateSuccess: false,
      errorMessage: "",
    });
  });

  it("should set the state error", () => {
    expect(reducer(undefined, setUpdateInterviewerErr("Error"))).toEqual({
      updateSuccess: false,
      errorMessage: "Error",
    });
  });

  it("should set the updateSuccess to true", () => {
    expect(reducer(undefined, setUpdateInterviewerSucc())).toEqual({
      updateSuccess: true,
      errorMessage: "",
    });
  });

  it("should set the updateSuccess to false", () => {
    expect(reducer(undefined, setUpdateInterviewerReq())).toEqual({
      updateSuccess: false,
      errorMessage: "",
    });
  });
});
