update some tests
This commit is contained in:
@@ -5,16 +5,12 @@ context('/examples/history', () => {
|
||||
|
||||
it('should not have a mistake', () => {
|
||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||
const html = editor.html()
|
||||
|
||||
cy.get('.ProseMirror h2:first').should('not.contain', 'Mistake')
|
||||
})
|
||||
})
|
||||
|
||||
it('should have a mistake', () => {
|
||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||
const html = editor.html()
|
||||
|
||||
editor.insertText('Mistake')
|
||||
cy.get('.ProseMirror h2:first').should('contain', 'Mistake')
|
||||
})
|
||||
@@ -22,8 +18,6 @@ context('/examples/history', () => {
|
||||
|
||||
it('the mistake should be removed again', () => {
|
||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||
const html = editor.html()
|
||||
|
||||
editor.undo()
|
||||
cy.get('.ProseMirror h2:first').should('not.contain', 'Mistake')
|
||||
})
|
||||
|
||||
@@ -3,9 +3,11 @@ context('/api/extensions/hard-break', () => {
|
||||
cy.visit('/api/extensions/hard-break')
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
beforeEach(done => {
|
||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||
editor.focus()
|
||||
editor.setContent('<p>Example Text</p>')
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -3,15 +3,16 @@ context('/api/extensions/history', () => {
|
||||
cy.visit('/api/extensions/history')
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
beforeEach(done => {
|
||||
cy.get('.ProseMirror').then(([{ editor }]) => {
|
||||
editor.focus()
|
||||
editor.setContent('<p>Mistake</p>')
|
||||
done()
|
||||
})
|
||||
})
|
||||
|
||||
it('should make the last change undone', () => {
|
||||
cy.get('.ProseMirror').should('contain', 'Mistake')
|
||||
|
||||
cy.get('.ProseMirror').contains('Mistake')
|
||||
cy.get('.demo__preview button:first').click({ force: true })
|
||||
cy.get('.ProseMirror').should('not.contain', 'Mistake')
|
||||
})
|
||||
@@ -22,12 +23,11 @@ context('/api/extensions/history', () => {
|
||||
})
|
||||
|
||||
it('should apply the last undone change again', () => {
|
||||
cy.get('.ProseMirror').should('contain', 'Mistake')
|
||||
|
||||
cy.get('.ProseMirror').contains('Mistake')
|
||||
cy.get('.demo__preview button:first').click({ force: true })
|
||||
cy.get('.ProseMirror').should('not.contain', 'Mistake')
|
||||
cy.get('.demo__preview button:nth-child(2)').click({ force: true })
|
||||
cy.get('.ProseMirror').should('contain', 'Mistake')
|
||||
cy.get('.ProseMirror').contains('Mistake')
|
||||
})
|
||||
|
||||
it.skip('the keyboard shortcut should apply the last undone change again', () => {
|
||||
@@ -35,6 +35,6 @@ context('/api/extensions/history', () => {
|
||||
cy.get('.ProseMirror').should('not.contain', 'Mistake')
|
||||
|
||||
cy.get('.ProseMirror').type('{meta}{shift}z', { force: true })
|
||||
cy.get('.ProseMirror').should('contain', 'Mistake')
|
||||
cy.get('.ProseMirror').contains('Mistake')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -13,15 +13,14 @@ context('/api/extensions/paragraph', () => {
|
||||
|
||||
it('text should be wrapped in a paragraph by default', () => {
|
||||
cy.get('.ProseMirror').type('Example Text', { force: true })
|
||||
cy.get('.ProseMirror').contains('p', 'Example Text')
|
||||
cy.get('.ProseMirror').find('p').should('have.length', 1)
|
||||
cy.get('.ProseMirror').find('p').should('contain', 'Example Text')
|
||||
})
|
||||
|
||||
it('enter should make a new paragraph', () => {
|
||||
cy.get('.ProseMirror').type('First Paragraph{enter}Second Paragraph', { force: true })
|
||||
cy.get('.ProseMirror').find('p').should('have.length', 2)
|
||||
cy.get('.ProseMirror').contains('p:first', 'First Paragraph')
|
||||
cy.get('.ProseMirror').contains('p:nth-child(2)', 'Second Paragraph')
|
||||
cy.get('.ProseMirror').find('p:first').should('contain', 'First Paragraph')
|
||||
cy.get('.ProseMirror').find('p:nth-child(2)').should('contain', 'Second Paragraph')
|
||||
})
|
||||
|
||||
it('backspace should remove the second paragraph', () => {
|
||||
|
||||
Reference in New Issue
Block a user