@kiwicom/orbit-components
Version:
<div align="center"> <a href="https://orbit.kiwi" target="_blank"> <img alt="orbit-components" src="https://orbit.kiwi/wp-content/uploads/2018/08/orbit-components.png" srcset="https://orbit.kiwi/wp-content/uploads/2018/08/orbit-components@2x.png 2x"
30 lines (25 loc) • 796 B
JavaScript
// @flow
import * as React from "react";
import { shallow } from "enzyme";
import Button from "../../Button";
import Airplane from "../../icons/Airplane";
import ButtonGroup from "../index";
const children = "button";
describe("ButtonGroup", () => {
const dataTest = "test";
const component = shallow(
<ButtonGroup dataTest={dataTest}>
<Button type="secondary">{children}</Button>
<Button icon={<Airplane />}>{children}</Button>
</ButtonGroup>,
);
it("first child should match snapshot", () => {
expect(component.find("Button").first()).toMatchSnapshot();
});
it("should have data-test", () => {
expect(component.render().prop("data-test")).toBe(dataTest);
});
it("should match snapshot", () => {
expect(component).toMatchSnapshot();
});
});