Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
1.03 kB
import React from "react";
import { render, fireEvent } from "@testing-library/react";
import { html as beautify_html } from "js-beautify";
import {
activeSlide,
clickNext,
clickPrevious,
getButtons,
getCurrentSlide
} from "../../test-utils";
import FocusOnSelect from "../FocusOnSelect";
describe("FocusOnSelect Tests", () => {
test("Activity Test", () => {
const { container } = render(<FocusOnSelect />);
expect(
parseInt(getCurrentSlide(container).getAttribute("data-index"))
).toEqual(0);
// expect(beautify_html(toString(container))).toMatchSnapshot();
Array.from(container.getElementsByClassName("slick-slide")).map(e =>
e.getAttribute("data-index") == "2"
? fireEvent(
e,
new MouseEvent("click", { bubbles: true, cancelable: true })
)
: null
);
expect(
parseInt(getCurrentSlide(container).getAttribute("data-index"))
).toEqual(2);
//expect(beautify_html(toString(container))).toMatchSnapshot();
});
});