Merge branch 'main' into feature/vue-node-views

This commit is contained in:
Philipp Kühn
2020-11-25 10:00:13 +01:00
58 changed files with 483 additions and 275 deletions

View File

@@ -0,0 +1,22 @@
context('/examples/basic', () => {
before(() => {
cy.visit('/examples/basic')
})
beforeEach(() => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.setContent('<h1>Example Text</h1>')
editor.commands.selectAll()
})
})
it('should apply the paragraph style when the keyboard shortcut is pressed', () => {
cy.get('.ProseMirror h1').should('exist')
cy.get('.ProseMirror p').should('not.exist')
cy.get('.ProseMirror')
.trigger('keydown', { modKey: true, altKey: true, key: '0' })
.find('p')
.should('contain', 'Example Text')
})
})

View File

@@ -1,25 +0,0 @@
context('clearContent', () => {
before(() => {
cy.visit('/examples/basic')
})
it('returns true for the clearContent command', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.setContent('<p>Example Text</p>')
const command = editor.commands.clearContent()
expect(command).to.be.eq(true)
})
})
it('clears the content when using the clearContent command', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.setContent('<p>Example Text</p>')
editor.commands.clearContent()
expect(editor.getHTML()).to.be.eq('<p></p>')
})
})
})

View File

@@ -1,25 +0,0 @@
context('insertHTML', () => {
before(() => {
cy.visit('/examples/basic')
})
it('returns true for the insertHTML command', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.setContent('<p>Example Text</p>')
const command = editor.commands.insertHTML('<p>Cindy Lauper</p>')
expect(command).to.be.eq(true)
})
})
it('appends the content when using the insertHTML command', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.setContent('<p>Example Text</p>')
editor.commands.insertHTML('<p>Cindy Lauper</p>')
expect(editor.getHTML()).to.be.eq('<p>Example Text</p><p>Cindy Lauper</p>')
})
})
})

View File

@@ -1,21 +0,0 @@
context('setContent', () => {
before(() => {
cy.visit('/examples/basic')
})
it('returns true for the setContent command', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
const command = editor.commands.setContent('<p>Example Text</p>')
expect(command).to.be.eq(true)
})
})
it('clears the content when using the setContent command', () => {
cy.get('.ProseMirror').then(([{ editor }]) => {
editor.commands.setContent('<p>Cindy Lauper</p>')
expect(editor.getHTML()).to.be.eq('<p>Cindy Lauper</p>')
})
})
})

View File

@@ -2,4 +2,6 @@ context('/examples/collaborative-editing', () => {
before(() => {
cy.visit('/examples/collaborative-editing')
})
// TODO: Write tests
})

View File

@@ -1,5 +0,0 @@
context('/examples/collaborative-editing-ws', () => {
before(() => {
cy.visit('/examples/collaborative-editing-ws')
})
})

View File

@@ -0,0 +1,7 @@
context('/examples/formatting', () => {
before(() => {
cy.visit('/examples/formatting')
})
// TODO: Write tests
})

View File

@@ -0,0 +1,7 @@
context('/examples/links', () => {
before(() => {
cy.visit('/examples/links')
})
// TODO: Write tests
})

View File

@@ -2,4 +2,6 @@ context('/examples/minimalist', () => {
before(() => {
cy.visit('/examples/minimalist')
})
// TODO: Write tests
})

View File

@@ -2,4 +2,6 @@ context('/examples/todo-app', () => {
before(() => {
cy.visit('/examples/todo-app')
})
// TODO: Write tests
})

View File

@@ -0,0 +1,7 @@
context('/examples/v-model', () => {
before(() => {
cy.visit('/examples/v-model')
})
// TODO: Write tests
})