import reducer from "../../../store/reducers/user/inviteUserReducer";
import expect from "expect";
import { inviteUserError, inviteUserSuccess } from "../../../store/actions/users/usersActions";

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

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

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