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

import type { NumberedBulletProps } from './numbered-bullet.proptypes';
import { NumberedBullet } from './index';

const DEFAULT_PROPS: NumberedBulletProps = {
  value: '2',
};

describe('NumberedBullet', () => {
  describe('snapshot', () => {
    it('is disabled', () => {
      const numberedBullet = renderSnapshot(
        <NumberedBullet {...DEFAULT_PROPS} disabled />,
      );
      expect(numberedBullet).toMatchSnapshot();
    });

    it('is not disabled', () => {
      const numberedBullet = renderSnapshot(
        <NumberedBullet {...DEFAULT_PROPS} disabled={false} />,
      );
      expect(numberedBullet).toMatchSnapshot();
    });
  });

  it('renders value text based on props', () => {
    const value = 'some-default-value';
    const numberedBullet = mountWrappedComponent(
      <NumberedBullet {...DEFAULT_PROPS} disabled={false} value={value} />,
    );

    expect(numberedBullet.find('text').text()).toBe(value);
  });
});
