Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import React from "react";
  2. import Button from "../button";
  3. import faker from "faker";
  4. import Enzyme, { mount } from "enzyme";
  5. import Adapter from 'enzyme-adapter-react-16';
  6. import sinon from "sinon";
  7.  
  8. Enzyme.configure({ adapter: new Adapter() });
  9.  
  10. describe("button specs", () => {
  11. const sandbox = sinon.createSandbox();
  12.  
  13. afterEach(() => {
  14. sandbox.verifyAndRestore();
  15. });
  16.  
  17. it ("should render button component", () => {
  18. const text = faker.random.word();
  19. const wrapper = mount(<Button>{text}</Button>);
  20.  
  21. expect(wrapper.find("button")).toHaveLength(1);
  22. });
  23. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement