import reducer from "../../../store/reducers/screeningTests/screeningTestsReducer";
import expect from "expect";
import { fetchScreeningTestsError, fetchScreeningTestsSuccess } from "../../../store/actions/screeningTests/screeningTestActions";

describe("screening tests reducer", () => {
  it("should set tests", () => {
    expect(
      reducer(undefined, fetchScreeningTestsSuccess(["test1", "test2"]))
    ).toEqual({
      screeningTests: ["test1", "test2"],
      errorMessage: "",
    });
  });

  it("should set error", () => {
    expect(reducer(undefined, fetchScreeningTestsError("Error"))).toEqual({
      screeningTests: [],
      errorMessage: "Error",
    });
  });
});
