Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from "react";
- import Button from "../button";
- import faker from "faker";
- import Enzyme, { mount } from "enzyme";
- import Adapter from 'enzyme-adapter-react-16';
- import sinon from "sinon";
- Enzyme.configure({ adapter: new Adapter() });
- describe("button specs", () => {
- const sandbox = sinon.createSandbox();
- afterEach(() => {
- sandbox.verifyAndRestore();
- });
- it ("should render button component", () => {
- const text = faker.random.word();
- const wrapper = mount(<Button>{text}</Button>);
- expect(wrapper.find("button")).toHaveLength(1);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement