diff --git a/app/components/BookBuilder/Chapter/test/ProgressItem.spec.js b/app/components/BookBuilder/Chapter/test/ProgressItem.spec.js new file mode 100644 index 0000000000000000000000000000000000000000..8f2c42a30fc309800f3375c4da1dd57a630f1439 --- /dev/null +++ b/app/components/BookBuilder/Chapter/test/ProgressItem.spec.js @@ -0,0 +1,30 @@ +import React from 'react' +import { shallow } from 'enzyme' +import { shallowToJson } from 'enzyme-to-json' +import sinon from 'sinon' + +import ProgressItem from '../ProgressItem' + +const { data } = global.mock +const type = 'front' +const chapters = data.chapters.filter((chapter) => { + return chapter.division === type +}) + +let props = { + chapter: chapters[0], + type: 'edit', + modalContainer: {}, + update: sinon.spy(), + roles: [] +} + +const getWrapper = () => { + return shallow(<ProgressItem {...props} />) +} + +test('should render correctly', () => { + const wrapper = getWrapper() + const tree = shallowToJson(wrapper) + expect(tree).toMatchSnapshot() +})