add hostic-dom

This commit is contained in:
Hans Pagel
2020-10-28 17:12:25 +01:00
parent c353a7f01f
commit 4af6049792
6 changed files with 68 additions and 290 deletions

View File

@@ -0,0 +1,29 @@
/// <reference types="cypress" />
import generateHtml from '@tiptap/html'
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
describe('generateHtml', () => {
it('generate HTML from JSON without an editor instance', () => {
const json = {
type: 'document',
content: [{
type: 'paragraph',
content: [{
type: 'text',
text: 'Example Text',
}],
}],
}
const html = generateHtml(json, [
Document(),
Paragraph(),
Text(),
])
expect(html).to.eq('<p>Example Text</p>')
})
})