Skip to content
Snippets Groups Projects
Commit 1b455824 authored by Alexandros Georgantas's avatar Alexandros Georgantas Committed by john
Browse files

Added render test for the Chapter

parent 16c5a843
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,8 @@ import {
// mount,
shallow
} from 'enzyme'
import { shallowToJson } from 'enzyme-to-json'
import sinon from 'sinon'
// import { DropdownButton } from 'react-bootstrap'
// import { DragDropContext } from 'react-dnd'
......@@ -13,39 +15,37 @@ import {
// // grab the undecorated by dnd react component
import Chapter from '../Chapter'
const OriginalChapter = Chapter.DecoratedComponent.DecoratedComponent
const OriginalChapter = Chapter.DecoratedComponent
// import ProgressIndicator from '../ProgressIndicator'
// import TextInput from '../../../components/TextInput'
// const identity = function (el) { return el }
const identity = el => el
const { data } = global.mock
const type = 'front'
const chapters = data.chapters.filter((chapter) => {
return chapter.division === type
})
const firstChapter = chapters[0]
let props = {
book: data.book,
chapter: data.chapters[0]
// connectDragSource: identity,
// connectDropTarget: identity,
// isDragging: false,
//
// title: 'This title',
// type: 'chapter',
// chapter: {
// id: '123',
// alignment: {},
// division: 'front',
// progress: {
// style: 0,
// edit: 0,
// review: 0,
// clean: 0
// }
// },
// remove: sinon.spy(),
// update: sinon.spy(),
// roles: [],
// outerContainer: {}
chapter: firstChapter,
id: firstChapter.id,
ink: sinon.spy(),
key: firstChapter.index,
move: sinon.spy(),
no: 0,
outerContainer: {},
remove: sinon.spy(),
roles: [],
title: firstChapter.title,
type: firstChapter.subCategory,
update: sinon.spy(),
connectDragSource: identity,
connectDropTarget: identity,
isDragging: false
}
// function wrapInTestContext (Chapter) {
......@@ -64,7 +64,8 @@ const getWrapper = () => {
test('should render correctly', () => {
const wrapper = getWrapper()
expect(wrapper).toMatchSnapshot()
const tree = shallowToJson(wrapper)
expect(tree).toMatchSnapshot()
})
// describe('Chapter', () => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment