import reducer from "../../../store/reducers/applicants/applyForAdReducer";
import expect from "expect";
import {
  applyForAd,
  applyForAdError,
} from "../../../store/actions/applyForAd/applyForAdActions";

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

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

  it("should set the state success", () => {
    expect(reducer(undefined, applyForAd())).toEqual({
      errorMessage: "",
    });
  });
});
