import { render, waitFor } from "@testing-library/react";

import TabPanel from "./index";
import addSnapshotSerializer from "../../../utils/snapshot";

const renderTabPanel = async () => {
  const { container } = render(
    <TabPanel value={0} index={0}>
      <div>Test</div>
    </TabPanel>
  );
  await waitFor(() => {});
  return container;
};

describe("TabPanel", () => {
  beforeAll(() => {
    addSnapshotSerializer(expect);
  });

  it("Render", async () => {
    const container = await renderTabPanel();
    expect(container).toMatchSnapshot();
  });
});
