import React from 'react';
import ReactTestRenderer from 'react-test-renderer';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16/build/index';
import { Spinner } from 'app/shared/components/spinner/spinner';
import { ConsoleMock } from 'app/testUtils/consoleMock';

describe('Spinner component tests', () => {
  Enzyme.configure({ adapter: new Adapter() });
  let consoleMock;

  beforeEach(() => {
    consoleMock = new ConsoleMock();
  });

  afterEach(() => {
    consoleMock.destroy();
  });

  it('renders correctly without parameters', () => {
    const tree = ReactTestRenderer
      .create(<Spinner />)
      .toJSON();
    expect(tree).toMatchSnapshot();
  });
});
