1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from "react";
6 import { mount, configure } from "enzyme";
7 import { DataTableFilters } from "./data-table-filters";
8 import * as Adapter from 'enzyme-adapter-react-16';
9 import { Checkbox, ButtonBase } from "@material-ui/core";
11 configure({ adapter: new Adapter() });
13 describe("<DataTableFilter />", () => {
14 it("renders filters according to their state", () => {
22 const dataTableFilter = mount(<DataTableFilters name="" filters={filters} />);
23 dataTableFilter.find(ButtonBase).simulate("click");
24 expect(dataTableFilter.find(Checkbox).at(0).prop("checked")).toBeTruthy();
25 expect(dataTableFilter.find(Checkbox).at(1).prop("checked")).toBeFalsy();