UNPKG

ui-neu

Version:

Neu UI, a responsive React component library.

26 lines 896 B
import React from "react"; import { act } from "react-dom/test-utils"; import { render, unmountComponentAtNode } from "react-dom"; import { Select } from "./Select"; describe("Select test suite", function () { var container = null; beforeEach(function () { container = document.createElement("div"); document.body.appendChild(container); }); afterEach(function () { unmountComponentAtNode(container); container.remove(); container = null; }); it("renders Select children props", function () { act(function () { render( /*#__PURE__*/React.createElement(Select, { options: ["Option 1", "Option 2", "Option 3"] }, "Please select an option"), container); }); var select = document.querySelector("select"); expect(select.firstChild.textContent).toBe("Please select an option"); expect(select.childElementCount).toBe(4); }); });