import React from "react";
import "@testing-library/jest-native";
import { render, fireEvent } from "@testing-library/react-native";
import { OrganismFilterAccordion } from ".";

const mockHandler = jest.fn();
const props = [
  {
    id: 1,
    accordionTitle: "Categories",
    value: "categories",
    filters: [
      {
        type: "check",
        text: "Home",
        value: "home",
      },
      {
        type: "check",
        text: "Sweepstakes",
        value: "sweepstakes",
      },
      {
        type: "check",
        text: "Clothes",
        value: "clothes",
      },
      {
        type: "check",
        text: "Accesories",
        value: "accesories",
      },
    ],
    sortButtons: [],
  },
  {
    id: 2,
    accordionTitle: "Brand",
    value: "brand",
    filters: [
      {
        type: "check",
        text: "Bud Light",
        value: "bud_light",
      },
      {
        type: "check",
        text: "Budweiser",
        value: "budweiser",
      },
      {
        type: "check",
        text: "Busch",
        value: "busch",
      },
      {
        type: "check",
        text: "Michelob Ultra",
        value: "michelob_ultra",
      },
      {
        type: "check",
        text: "Natural Light",
        value: "natural_light",
      },
      {
        type: "check",
        text: "Corona",
        value: "corona",
      },
    ],
    sortButtons: [],
  },
  {
    id: 3,
    accordionTitle: "Sort By",
    value: "",
    filters: [],
    sortButtons: [
      {
        title: "Alphabeticaly",
        buttons: [
          {
            id: 1,
            text: "A - Z",
            selected: true,
          },
          {
            id: 2,
            text: "Z - A",
            selected: false,
          },
        ],
      },
      {
        title: "By price",
        buttons: [
          {
            id: 3,
            text: "$ - $$$",
            selected: false,
          },
          {
            id: 4,
            text: "$$$ - $",
            selected: false,
          },
        ],
      },
    ],
  },
];
describe("[Native] FilterAccordion", () => {
  it("render component", () => {
    // const component = render(<OrganismFilterAccordion accordionElements={props} handleClear={mockHandler} handleShow={mockHandler} />);
    // expect(component).toBeTruthy();
  });
  // it('handles toggle click', async () => {
  //   const { findByTestId  } = render(
  //     <OrganismFilterAccordion accordionElements={props} handleClear={mockHandler} handleShow={mockHandler} />
  //   );
  //   const event = await findByTestId('button-1');
  //   const other = await findByTestId('collapsible-1')

  //   fireEvent.press(event);

  //   expect(other).toBeDefined();

  // });
});
