{"size": 937, "ext": "js", "max_stars_repo_path": "src/__tests__/reducers/signup.js", "max_stars_repo_name": "emmaadesile/ride-my-way-client", "max_stars_repo_stars_event_min_datetime": "2019-03-21T14:21:10.000Z", "max_stars_repo_stars_event_max_datetime": "2019-03-21T14:21:10.000Z", "max_issues_repo_path": "src/__tests__/reducers/signup.js", "max_issues_repo_name": "emmaadesile/ride-my-way-client", "max_issues_repo_issues_event_min_datetime": "2018-10-03T17:35:41.000Z", "max_issues_repo_issues_event_max_datetime": "2018-11-04T13:49:38.000Z", "max_forks_repo_path": "src/__tests__/reducers/signup.js", "max_forks_repo_name": "emmaadesile/ride-my-way-client", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 15, "max_forks_count": null, "avg_line_length": 24.6578947368, "max_line_length": 77, "alphanum_fraction": 0.5613660619}
import signup from "../../reducers/signup";
import * as types from "../../actionTypes/signup";

describe("signup reducer", () => {
  it("should return initial state", () => {
    expect(signup(undefined, {})).toEqual({
      loading: false,
      error: "",
      message: ""
    });
  });

  it("should handle SINGUP_LOADING", () => {
    const action = { type: types.SIGNUP_LOADING, payload: true };
    expect(signup({}, action)).toEqual({
      loading: true,
      error: ""
    });
  });

  it("should handle SINGUP_ERROR", () => {
    const action = { type: types.SIGNUP_ERROR, payload: { error: "error" } };
    expect(signup({}, action)).toEqual({
      error: "error"
    });
  });

  it("should handle SIGNUP_SUCCESS", () => {
    const action = {
      type: types.SIGNUP_SUCCESS,
      payload: "Signup was successful"
    };
    expect(signup({}, action)).toEqual({
      message: "Signup was successful"
    });
  });
});
