import * as React from 'react'; import { mount } from 'enzyme'; import Heading from '../../Heading'; import Process from '../../Process'; const steps = [ { name: 'StepOne', component: test0 }, { name: 'StepTwo', component: test1 }, { name: 'StepThree', component: test2 }, { name: 'StepFour', component: test3 } ]; describe('', () => { describe('when default props are provided', () => { it('should have default process elements', () => { const subject = mount( ); expect(subject.find('ul').exists()).toBeTruthy(); expect(subject.find('li').exists()).toBeTruthy(); expect(subject.find('div').exists()).toBeTruthy(); expect(subject.find('li').length).toBe(4); }); }); describe('when allowBackStepping props are provided', () => { it('should have allowBackStepping true process elements', () => { const subject = mount( ); expect(subject.find('ul').exists()).toBeTruthy(); expect(subject.find('li').exists()).toBeTruthy(); expect(subject.find('div').exists()).toBeTruthy(); expect(subject.find('li').length).toBe(4); }); }); describe('when callback props are provided', () => { it('should have callbackfunction as props in process elements', () => { const spy = jest.fn(); const subject = mount( ); expect(subject.find('ul').exists()).toBeTruthy(); expect(subject.find('li').exists()).toBeTruthy(); expect(subject.find('div').exists()).toBeTruthy(); expect(subject.find('li').length).toBe(4); }); }); describe('when callback props for updating state to call next and previous state from outside area are provided', () => { it('should have callbackfunction for updating state of next and previous as props in process elements', () => { const spy = jest.fn(); const subject = mount( ); expect(subject.find('ul').exists()).toBeTruthy(); expect(subject.find('li').exists()).toBeTruthy(); expect(subject.find('div').exists()).toBeTruthy(); expect(subject.find('li').length).toBe(4); }); }); });