chore(#207): added more descriptive tests

This commit is contained in:
hugoazevedosoares
2019-10-17 06:52:11 -03:00
committed by Priscila Oliveira
parent f5c77ff43c
commit ff791a35f7
2 changed files with 17 additions and 1 deletions

View File

@@ -2,10 +2,26 @@ import React from 'react';
import { shallow } from 'enzyme';
import Spinner from './Spinner';
import { Circular, Wrapper } from './styles';
describe('<Spinner /> component', () => {
test('should render the component in default state', () => {
const wrapper = shallow(<Spinner />);
const wrapperComponent = wrapper.find(Wrapper);
const circular = wrapper.find(Circular);
expect(circular.props().size).toBe(50);
expect(wrapperComponent.props().centered).toBe(false);
});
test('should render the component in custom state', () => {
const wrapper = shallow(<Spinner centered={true} size={10} />);
const wrapperComponent = wrapper.find(Wrapper);
const circular = wrapper.find(Circular);
expect(circular.props().size).toBe(10);
expect(wrapperComponent.props().centered).toBe(true);
expect(wrapper.html()).toMatchSnapshot();
});
});