UNPKG

phoenix-components-library

Version:

Component library for Phoenix Frontend Projects.

26 lines (21 loc) 798 B
import React from "react"; import renderer from "react-test-renderer"; import { Switch } from "./Switch"; describe("<Switch />", () => { test("Render Switch correctly", () => { const tree = renderer.create(<Switch defaultChecked />).toJSON(); expect(tree).toMatchSnapshot(); }); test("Render Switch which is currently unchecked", () => { const tree = renderer.create(<Switch defaultChecked={false} />).toJSON(); expect(tree).toMatchSnapshot(); }); test("Render small Switch", () => { const tree = renderer.create(<Switch defaultChecked small />).toJSON(); expect(tree).toMatchSnapshot(); }); test("Render disabled Switch", () => { const tree = renderer.create(<Switch defaultChecked disabled />).toJSON(); expect(tree).toMatchSnapshot(); }); });