<commit_before>import React from "react";
import Adapter from "enzyme-adapter-react-16";
import { mount, configure } from "enzyme";

import { SelectionBar } from ".";

describe("Table/SelectionBar", function() {
  configure({ adapter: new Adapter() });

  test("Click on Clear button should call clear function", function() {
    const clearFunctionMock = jest.fn();
    const component = mount(
      <SelectionBar clearSelection={clearFunctionMock} />
    );
    const clearButton = component.find(".clear button");
    clearButton.simulate("click");
    expect(clearFunctionMock).toBeCalled();
  });

  test("Click on an action button should call their function", function() {
    const primaryActionMock = jest.fn();
    const secondaryActionMock = jest.fn();
    const component = mount(
      <SelectionBar
        primaryAction={primaryActionMock}
        secondaryAction={secondaryActionMock}
      />
    );
    const primaryButton = component.find(".actions button").last();
    primaryButton.simulate("click");
    expect(primaryActionMock).toBeCalled();
    const secondaryButton = component.find(".actions button").first();
    secondaryButton.simulate("click");
    expect(secondaryActionMock).toBeCalled();
  });
});<commit_msg>test(table): update tests for SelectionBar refactor<commit_after>import React from "react";
import Adapter from "enzyme-adapter-react-16";
import { mount, configure } from "enzyme";

import { SelectionBar } from ".";

describe("Table/SelectionBar", function() {
  configure({ adapter: new Adapter() });

  test("Click on Clear button should call clear function", function() {
    const clearFunctionMock = jest.fn();
    const component = mount(
      <SelectionBar clearSelection={clearFunctionMock} />
    );
    const clearButton = component.find(".clear button");
    clearButton.simulate("click");
    expect(clearFunctionMock).toBeCalled();
  });
});
{'fraction_non_alphanumeric': 0.1358609794628752, 'fraction_numerical': 0.00210637177461822, 'mean_word_length': 4.38243626062323, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '6187811', 'n_tokens_mistral': 494, 'n_tokens_neox': 486, 'n_words': 129}