rename HTML function names

This commit is contained in:
Hans Pagel
2020-10-28 17:20:38 +01:00
parent 4af6049792
commit 4dad818f7d
9 changed files with 21 additions and 21 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>')
})
})