// @flow
import React from 'react';
import { renderSnapshot, itIsAccessible } from '../../../../utils/tests';
import * as Stories from './range.story';
import { Range } from '.';

const defaultProps = {
  label: 'Label',
  min: 1,
  max: 8,
  value: 2,
  onRangeChange: jest.fn(),
};
describe('Range', () => {
  describe('Snapshots', () => {
    it('renders', () => {
      const range = renderSnapshot(<Stories.Interactive />);
      expect(range).toMatchSnapshot();
    });
  });

  describe('with an ariaLabelledBy label', () => {
    itIsAccessible(<Stories.RiskScoreExample />);
  });

  describe('With regular label prop passed', () => {
    itIsAccessible(<Range {...defaultProps} />);
  });
});
