import reducer from "../../../store/reducers/schedule/scheduleReducer";
import expect from "expect";
import {
  fetchScheduleError,
  fetchScheduleSuccess,
} from "../../../store/actions/schedule/scheduleActions";

describe("schedule reducer", () => {
  it("should set schedule", () => {
    expect(reducer(undefined, fetchScheduleSuccess(["1", "2"]))).toEqual({
      schedule: ["1", "2"],
      errorMessage: "",
    });
  });

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