
// Base mock data that can be shared
const baseMockData = {
  isUploading: false,
  emailCreateMode: "editor",
  step: "modeSelection",
  isFullMode: true,
  cmsTemplates: [
    {
      _id: "template1",
      name: "Template 1",
      content: "<html><body>Template 1 Content</body></html>"
    },
    {
      _id: "template2",
      name: "Template 2",
      content: "<html><body>Template 2 Content</body></html>"
    }
  ]
};

export const EmailWrapperMockData = {
  ...baseMockData,
  onEmailModeChange: jest.fn(),
  showTemplateName: jest.fn(),
  isGetFormData: false,
  getFormdata: jest.fn(),
  type: "email",
  cap: { currentOrgDetails: { basic_details: {} } },
  setIsLoadingContent: jest.fn(),
  onValidationFail: jest.fn(),
  forwardedTags: {},
  selectedOfferDetails: [],
  onPreviewContentClicked: jest.fn(),
  onTestContentClicked: jest.fn(),
  editor: {},
  moduleType: "email",
  showLiquidErrorInFooter: jest.fn(),
  eventContextTags: [],
  isLoyaltyModule: false,
  templatesActions: {
    resetTemplateData: jest.fn(),
    getDefaultBeeTemplates: jest.fn(),
    handleZipUpload: jest.fn(),
    handleHtmlUpload: jest.fn(),
    setEdmTemplate: jest.fn(),
    setBEETemplate: jest.fn()
  },
  showNextStep: jest.fn(),
  onResetStep: jest.fn(),
  onEnterTemplateName: jest.fn(),
  onRemoveTemplateName: jest.fn(),
  getCmsTemplatesInProgress: false,
  EmailLayout: null,
  SelectedEdmDefaultTemplate: null,
  cmsTemplatesLoader: false,
  currentOrgDetails: { basic_details: {} },
  intl: {
    formatMessage: jest.fn(message => message.defaultMessage || "")
  }
};

export const EmailWrapperViewMockProps = {
  ...baseMockData,
  templateName: "Test Template",
  onTemplateNameChange: jest.fn(),
  isTemplateNameEmpty: false,
  modes: [
    {
      title: "Upload zip file",
      content: "Upload compressed file (Zip) containing HTML & images",
      value: "upload"
    },
    {
      title: "Create using editor",
      content: "Create using in-built template",
      value: "editor"
    }
  ],
  onChange: jest.fn(),
  EmailLayout: null,
  modeContent: {},
  useFileUpload: jest.fn(),
  uploadButtonLabel: "Upload",
  isShowEmailCreate: false,
  emailProps: {
    key: "email-create-template",
    location: {
      pathname: `/email/create`,
      query: { module: "library", type: "embedded" }
    },
    route: { name: "email" },
    params: {},
    isGetFormData: false,
    getFormdata: jest.fn(),
    getFormSubscriptionData: jest.fn(),
    getDefaultTags: "email",
    isFullMode: true,
    defaultData: { "template-name": "Test Template" },
    cap: { currentOrgDetails: { basic_details: {} } },
    showTemplateName: jest.fn(),
    showLiquidErrorInFooter: jest.fn(),
    onValidationFail: jest.fn(),
    forwardedTags: {},
    selectedOfferDetails: [],
    onPreviewContentClicked: jest.fn(),
    onTestContentClicked: jest.fn(),
    editor: {},
    moduleType: "email",
    eventContextTags: [],
    isLoyaltyModule: false
  },
  cmsTemplatesProps: {
    cmsTemplates: baseMockData.cmsTemplates,
    handleEdmDefaultTemplateSelection: jest.fn(),
    cmsTemplatesLoader: false,
    currentOrgDetails: { basic_details: {} }
  }
};
