// @flow
import React from 'react';
import { renderSnapshot } from '../../../../utils/tests';

import type { TagProps } from './tag.proptypes';
import { Tag } from './index';

const DEFAULT_PROPS: TagProps = {
  inverted: false,
};

describe('Tag', () => {
  describe('snapshot', () => {
    it('matches the previous snapshot', () => {
      const tag = renderSnapshot(<Tag {...DEFAULT_PROPS} />);

      expect(tag).toMatchSnapshot();
    });
  });

  describe('when passing a color', () => {
    it('has the correct styling', () => {
      const tag = renderSnapshot(<Tag color="error" />);

      expect(tag).toMatchSnapshot();
    });
  });

  describe('when passing an inverted color', () => {
    it('has the correct styling', () => {
      const tag = renderSnapshot(<Tag color="error" inverted />);

      expect(tag).toMatchSnapshot();
    });
  });
});
