message: Add sandbox and aftereach functions
diff: @@ -9,52 +9,62 @@ 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 = shallow(<Button>{text}</Button>);
  + const wrapper = shallow(<Button onClick={()=> {}}>{text}</Button>);
  expect(wrapper.text()).toEqual(text);
  });
  it("should call callback function when clicked", () => {
  - const spy = sinon.spy();
  + const spy = sandbox.spy();
  const wrapper = mount(<Button onClick={spy} />);
  wrapper.find("button").simulate("click");
  expect(spy.calledOnce).toEqual(true);
  +
  +
  });
  it("should not call callback function when clicked but button is disabled", () => {
  - const spy = sinon.spy();
  + const spy = sandbox.spy();
  const wrapper = mount(<Button onClick={spy} disabled />);
  wrapper.find("button").simulate("click");
  expect(spy.callCount).toEqual(0);
  +
  });
  - it("should be rendered with given primary variant prop", () => {
  + it("should have className primary when given primary prop", () => {
  - const wrapper = mount(<Button variant={'primary'} />);
  + const wrapper = mount(<Button onClick={()=> {}} variant={'primary'} />);
  expect(wrapper.exists(".primary")).toEqual(true);
  });
  - it("should be rendered with given large size prop", () => {
  + it("should have className large when given large prop", () => {
  - const wrapper = mount(<Button size={'large'} />);
  + const wrapper = mount(<Button onClick={()=> {}} size={'large'} />);
  expect(wrapper.exists(".large")).toEqual(true);
  });
  - it("should have className fluid when given prop fluid", () => {
  + it("should have className fluid when given fluid prop", () => {
  - const wrapper = mount(<Button fluid />);
  + const wrapper = mount(<Button onClick={()=> {}} fluid />);
  expect(wrapper.exists(".fluid")).toEqual(true);
  });
  