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 { DataTableFiltersPopover } from "./data-table-filters-popover";
8 import * as Adapter from 'enzyme-adapter-react-16';
9 import { Checkbox, IconButton } from "@material-ui/core";
10 import { getInitialProcessStatusFilters } from "~/store/resource-type-filters/resource-type-filters"
12 configure({ adapter: new Adapter() });
14 describe("<DataTableFiltersPopover />", () => {
15 it("renders filters according to their state", () => {
16 // 1st filter (All) is selected, the rest aren't.
17 const filters = getInitialProcessStatusFilters()
19 const dataTableFilter = mount(<DataTableFiltersPopover name="" filters={filters} />);
20 dataTableFilter.find(IconButton).simulate("click");
21 expect(dataTableFilter.find(Checkbox).at(0).prop("checked")).toBeTruthy();
22 expect(dataTableFilter.find(Checkbox).at(1).prop("checked")).toBeFalsy();