import React from "react";
import { injectIntl } from 'react-intl';
import '@testing-library/jest-dom';
import {
  render,
  /* eslint-disable import/named */
  screen,
  fireEvent,
  /* eslint-enable import/named */
} from '../../../utils/test-utils';
import { MarketingObjective } from "../index";


const initializeComponent = () => {
  const Component = injectIntl(MarketingObjective);
  return render( <Component
    defaultmarketingObjective="test"
    marketingObjectiveList={[{label: "test", panes: [{value: "test"}]}]}
    selectedMarketingObjective="test"
    onSubmit={() => {}}
    className=""
    onMarketingObjectiveSelect={() => {}}
  />);
};

describe('renders a MarketingObjective', () => {
  it("Test if MarketingObjective component renders", () => {
    initializeComponent();
    const button = screen.getByText('Done');
    expect(button).toBeInTheDocument();
    fireEvent.click(button);
  });
});
