import React from 'react';
import { render } from '@testing-library/react-native';
import { OrderCard } from '..';

const props = {
  title: 'Coca Cola',
  subtitle: `Orden de compra 89982`,
};

describe('Test OrderTag component', () => {
  it('render <OrderTag /> with status new', () => {
    const component = render(
      <OrderCard {...props} status={'new'} tagDescription={'Nueva'} />
    );
    expect(component).toBeDefined();
    expect(component.toJSON()).toMatchSnapshot();
  });
  it('render <OrderTag /> with status inProcess', () => {
    const component = render(
      <OrderCard
        {...props}
        status={'inProcess'}
        tagDescription={'En proceso'}
      />
    );
    expect(component).toBeDefined();
    expect(component.toJSON()).toMatchSnapshot();
  });
  it('render <OrderTag /> with status finalized', () => {
    const component = render(<OrderCard {...props} status={'finalized'} />);
    expect(component).toBeDefined();
    expect(component.toJSON()).toMatchSnapshot();
  });
  it('render <OrderTag /> with footer', () => {
    const component = render(
      <OrderCard
        {...props}
        status={'new'}
        tagDescription={'Nueva'}
        footer={'200 SKUs'}
      />
    );
    expect(component).toBeDefined();
    expect(component.toJSON()).toMatchSnapshot();
  });
  it('render <OrderTag /> with right text', () => {
    const component = render(
      <OrderCard
        {...props}
        status={'inProcess'}
        tagDescription={'En Proceso'}
        rightText={'$2.000.000'}
        footer={'200 SKUs'}
      />
    );
    expect(component).toBeDefined();
    expect(component.toJSON()).toMatchSnapshot();
  });
});
