really fix tests

This commit is contained in:
Hans Pagel
2020-09-11 15:57:33 +02:00
parent 2e67d64d68
commit 1b414ab33c
20 changed files with 501 additions and 514 deletions

View File

@@ -3,62 +3,60 @@ context('/examples/export-html-or-json', () => {
cy.visit('/examples/export-html-or-json')
})
describe('export', () => {
it('should return json', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
const json = editor.json()
it('should return json', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
const json = editor.json()
expect(json).to.deep.equal({
'type': 'document',
'content': [
{
'type': 'paragraph',
'content': [
{
'type': 'text',
'text': 'You are able to export your data as '
},
{
'type': 'text',
'marks': [
{
'type': 'code'
}
],
'text': 'HTML'
},
{
'type': 'text',
'text': ' or '
},
{
'type': 'text',
'marks': [
{
'type': 'code'
}
],
'text': 'JSON'
},
{
'type': 'text',
'text': '.'
}
]
}
]
})
})
})
it('should return html', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
const html = editor.html()
expect(html).to.equal('<p>You are able to export your data as <code>HTML</code> or <code>JSON</code>.</p>')
expect(json).to.deep.equal({
'type': 'document',
'content': [
{
'type': 'paragraph',
'content': [
{
'type': 'text',
'text': 'You are able to export your data as '
},
{
'type': 'text',
'marks': [
{
'type': 'code'
}
],
'text': 'HTML'
},
{
'type': 'text',
'text': ' or '
},
{
'type': 'text',
'marks': [
{
'type': 'code'
}
],
'text': 'JSON'
},
{
'type': 'text',
'text': '.'
}
]
}
]
})
})
})
it('should return html', () => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
const html = editor.html()
expect(html).to.equal('<p>You are able to export your data as <code>HTML</code> or <code>JSON</code>.</p>')
})
})
})