import React from "react"; import { screen, render } from "@test"; import { ExportButton } from "./"; describe("", () => { it("should render", () => { const { findByText } = render(); findByText("Export"); }); it("should render text by children", () => { const { container, getByText } = render( refine, ); expect(container).toBeTruthy(); getByText("refine"); }); it("should render without text show only icon", () => { const { container, queryByText } = render(); expect(container).toBeTruthy(); expect(queryByText("Export")).not.toBeInTheDocument(); }); it("should have text 'Export'", async () => { window.open = jest.fn(); render(); screen.getByText("Export"); }); });