<commit_before>import styles from './Slider.scss';
import SliderDriver from './Slider.driver';

describe('Slider', () => {
  let driver;

  beforeEach(() => {
    driver = new SliderDriver();
  });

  it('should render slider', () => {
    const onChange = jest.fn(value => this.setState({value}));

    driver
      .given.sliderData({min: 1, max: 10, value: [3]})
      .given.onChange(onChange)
      .when.created();

    expect(driver.get.sliderMarks().length).toBe(10);
    expect(driver.get.sliderHandles().length).toBe(1);
  });

  it('should render slider with multi-range', () => {
    const onChange = jest.fn(value => this.setState({value}));

    driver
      .given.sliderData({min: 1, max: 10, value: [3, 5, 7]})
      .given.onChange(onChange)
      .when.created();

    driver.get.element().find('.slider-handle').at(0).simulate('mouseEnter');
    console.log(driver.get.element().find('.slider-tooltip').text());
    expect(driver.get.sliderMarks().length).toBe(10);
    expect(driver.get.sliderHandles().length).toBe(3);
  });

  it('should show correct value on hover', () => {
    const onChange = jest.fn(value => this.setState({value}));

    const handleInitialValues = [3, 5, 7];

    driver
      .given.sliderData({min: 1, max: 10, value: handleInitialValues})
      .given.onChange(onChange)
      .when.created()
      .when.hoverHandle({handleIndex: 0});

    expect(driver.get.toolTipValue()).toBe(`${handleInitialValues[0]}`);

    driver
      .when.unHoverHandle({handleIndex: 0})
      .when.hoverHandle({handleIndex: 1});

    expect(driver.get.toolTipValue()).toBe(`${handleInitialValues[1]}`);
  });
});
<commit_msg>cleanup<commit_after>import styles from './Slider.scss';
import SliderDriver from './Slider.driver';

describe('Slider', () => {
  let driver;

  beforeEach(() => {
    driver = new SliderDriver();
  });

  it('should render slider', () => {
    const onChange = jest.fn(value => this.setState({value}));

    driver
      .given.sliderData({min: 1, max: 10, value: [3]})
      .given.onChange(onChange)
      .when.created();

    expect(driver.get.sliderMarks().length).toBe(10);
    expect(driver.get.sliderHandles().length).toBe(1);
  });

  it('should render slider with multi-range', () => {
    const onChange = jest.fn(value => this.setState({value}));

    driver
      .given.sliderData({min: 1, max: 10, value: [3, 5, 7]})
      .given.onChange(onChange)
      .when.created();

    expect(driver.get.sliderMarks().length).toBe(10);
    expect(driver.get.sliderHandles().length).toBe(3);
  });

  it('should show correct value on hover', () => {
    const onChange = jest.fn(value => this.setState({value}));

    const handleInitialValues = [3, 5, 7];

    driver
      .given.sliderData({min: 1, max: 10, value: handleInitialValues})
      .given.onChange(onChange)
      .when.created()
      .when.hoverHandle({handleIndex: 0});

    expect(driver.get.toolTipValue()).toBe(`${handleInitialValues[0]}`);

    driver
      .when.unHoverHandle({handleIndex: 0})
      .when.hoverHandle({handleIndex: 1});

    expect(driver.get.toolTipValue()).toBe(`${handleInitialValues[1]}`);
  });
});

{'fraction_non_alphanumeric': 0.1932826362484157, 'fraction_numerical': 0.017427122940430924, 'mean_word_length': 3.5035663338088443, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1277130', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1014, 'n_words': 178}