import React from 'react';
import { shallowWithIntl } from '../../../helpers/intl-enzym-test-helpers';
import { WhatsappStatusContainer } from '../index';
import mockdata from '../../mockdata';

const { whatsappTemplate1,whatsappTemplate2 } = mockdata;

describe('Test WhatsappStatusContainer component', () => {
  let renderedComponent;

  const renderFunction = (data) => {
    renderedComponent = shallowWithIntl(
      <WhatsappStatusContainer
        template={data}
      />
    );
  };

  it('Should render correct status component for whatsapp channel', () => {
    renderFunction(whatsappTemplate1);
    expect(renderedComponent).toMatchSnapshot();
    renderFunction(whatsappTemplate2);
    expect(renderedComponent).toMatchSnapshot();
    renderFunction({});
    expect(renderedComponent).toMatchSnapshot();
  });
});
