import * as types from "../constants";
import * as actions from "../actions";

describe("Test inapp actions", () => {
  test.concurrent("has a type of INAPP_TEMPLATE_CREATE_REQUEST action", () => {
    const payload = {};
    const expected = {
      type: types.INAPP_TEMPLATE_CREATE_REQUEST,
      payload,
    };
    expect(actions.createInAppTemplate(payload)).toEqual(expected);
  });

  test.concurrent("has a type of CLEAR_CREATE_RESPONSE_REQUEST action", () => {
    const expected = {
      type: types.CLEAR_CREATE_RESPONSE_REQUEST,
    };
    expect(actions.clearCreateResponse()).toEqual(expected);
  });
  test.concurrent("has a type of INAPP_EDIT_TEMPLATE_REQUEST action", () => {
    const expected = {
      type: types.INAPP_EDIT_TEMPLATE_REQUEST,
    };
    expect(actions.editTemplate()).toEqual(expected);
  });
  test.concurrent("has a type of RESET_EDIT_TEMPLATE action", () => {
    const expected = {
      type: types.RESET_EDIT_TEMPLATE,
    };
    expect(actions.resetEditTemplate()).toEqual(expected);
  });
  test.concurrent("has a type of GET_INAPP_TEMPLATE_DETAILS_REQUEST action", () => {
    const expected = {
      type: types.GET_INAPP_TEMPLATE_DETAILS_REQUEST,
      callback: undefined,
      channel: "INAPP",
      id: undefined,
    };
    expect(actions.getTemplateDetails()).toEqual(expected);
  });
  test.concurrent("has a type of UPLOAD_INAPP_ASSET_REQUEST action", () => {
    const expected = {
      type: types.UPLOAD_INAPP_ASSET_REQUEST,
    };
    expect(actions.uploadInAppAsset()).toEqual(expected);
  });
  test.concurrent("has a type of CLEAR_INAPP_ASSET action", () => {
    const expected = {
      type: types.CLEAR_INAPP_ASSET,
    };
    expect(actions.clearInAppAsset()).toEqual(expected);
  });
});
