import { shallow } from 'enzyme'; import Spinner from '@uidu/spinner'; import * as React from 'react'; import { ModalSpinner } from '../../index'; describe('Modal Spinner', () => { it('should show spinner', () => { const component = shallow( , ); expect(component.find(Spinner)).toHaveLength(1); }); it('should set spinner to inverted mode when specified to do so', () => { const component = shallow( , ); expect(component.find(Spinner).prop('invertColor')).toEqual(true); }); it('should set blanked background color to specified one', () => { const component = shallow( , ); expect(component.props().style.backgroundColor).toEqual('white'); }); it('should handle default (no props provided) case', () => { const component = shallow(); expect(component.props().style.backgroundColor).toEqual('none'); expect(component.find(Spinner).prop('invertColor')).toEqual(false); }); });