diff --git a/src/components/Spinner/Spinner.test.tsx b/src/components/Spinner/Spinner.test.tsx index eb147c5..0f9b523 100644 --- a/src/components/Spinner/Spinner.test.tsx +++ b/src/components/Spinner/Spinner.test.tsx @@ -2,10 +2,26 @@ import React from 'react'; import { shallow } from 'enzyme'; import Spinner from './Spinner'; +import { Circular, Wrapper } from './styles'; describe(' component', () => { test('should render the component in default state', () => { const wrapper = shallow(); + 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(); + 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(); }); }); diff --git a/src/components/Spinner/__snapshots__/Spinner.test.tsx.snap b/src/components/Spinner/__snapshots__/Spinner.test.tsx.snap index 855a859..f5595ed 100644 --- a/src/components/Spinner/__snapshots__/Spinner.test.tsx.snap +++ b/src/components/Spinner/__snapshots__/Spinner.test.tsx.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[` component should render the component in default state 1`] = `"
"`; +exports[` component should render the component in custom state 1`] = `"
"`;