add init test

This commit is contained in:
Philipp Kühn
2018-11-13 23:54:42 +01:00
parent 6cf66e2c7f
commit c0d853ff0e

View File

@@ -199,3 +199,16 @@ test('clear content', () => {
expect(editor.getHTML()).toEqual('<p></p>') expect(editor.getHTML()).toEqual('<p></p>')
}) })
test('init callback', done => {
const editor = new Editor({
content: '<p>Foo</p>',
onInit: ({ state, view }) => {
expect(state).toBeDefined()
expect(view).toBeDefined()
done()
},
})
editor.destroy()
})