UNPKG

monday-ui-react-core

Version:

Official monday.com UI resources for application development in React.js

53 lines (48 loc) 1.58 kB
import React from "react"; import renderer from "react-test-renderer"; import TabPanels from "../TabPanels"; import TabPanel from "../../TabPanel/TabPanel"; describe("<TabPanels />", () => { describe("Snapshot tests", () => { it("renders correctly with empty props", () => { const tree = renderer.create( <TabPanels> <TabPanel>First</TabPanel> <TabPanel>Second</TabPanel> <TabPanel>Third</TabPanel> </TabPanels> ).toJSON(); expect(tree).toMatchSnapshot(); }); it("renders correctly with the given active tab panel", () => { const tree = renderer.create( <TabPanels activeTabId={1}> <TabPanel>First</TabPanel> <TabPanel>Second</TabPanel> <TabPanel>Third</TabPanel> </TabPanels> ).toJSON(); expect(tree).toMatchSnapshot(); }); it("renders correctly with animation from left to right", () => { const tree = renderer.create( <TabPanels animationDirection="ltr"> <TabPanel>First</TabPanel> <TabPanel>Second</TabPanel> <TabPanel>Third</TabPanel> </TabPanels> ).toJSON(); expect(tree).toMatchSnapshot(); }); it("renders correctly with animation from right to left", () => { const tree = renderer.create( <TabPanels animationDirection="rtl"> <TabPanel>First</TabPanel> <TabPanel>Second</TabPanel> <TabPanel>Third</TabPanel> </TabPanels> ).toJSON(); expect(tree).toMatchSnapshot(); }); }); });