add before method again

This commit is contained in:
Hans Pagel 2020-09-11 17:51:57 +02:00
parent 464d3665db
commit a3466f1add
13 changed files with 52 additions and 13 deletions

View File

@ -1,10 +1,13 @@
context('/examples/markdown-shortcuts', () => {
beforeEach(() => {
before(() => {
cy.visit('/examples/markdown-shortcuts')
})
beforeEach((done) => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.clearContent()
done()
})
})

View File

@ -1,11 +1,14 @@
context('/api/extensions/blockquote', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/blockquote')
})
beforeEach((done) => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>Example Text</p>')
editor.selectAll()
done()
})
})

View File

@ -1,11 +1,14 @@
context('/api/extensions/bold', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/bold')
})
beforeEach((done) => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>Example Text</p>')
editor.selectAll()
done()
})
})
@ -34,6 +37,7 @@ context('/api/extensions/bold', () => {
cy.get('.ProseMirror')
.type('{meta}b', { force: true })
.should('not.exist')
cy.get('.ProseMirror strong').should('not.exist')
})

View File

@ -1,11 +1,14 @@
context('/api/extensions/code', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/code')
})
beforeEach((done) => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>Example Text</p>')
editor.selectAll()
done()
})
})

View File

@ -1,11 +1,14 @@
context('/api/extensions/code-block', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/code-block')
})
beforeEach((done) => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>Example Text</p>')
editor.selectAll()
done()
})
})

View File

@ -1,10 +1,13 @@
context('/api/extensions/hard-break', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/hard-break')
})
beforeEach((done) => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>Example Text</p>')
done()
})
})

View File

@ -1,11 +1,14 @@
context('/api/extensions/heading', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/heading')
})
beforeEach((done) => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>Example Text</p>')
editor.selectAll()
done()
})
})

View File

@ -1,10 +1,13 @@
context('/api/extensions/history', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/history')
})
beforeEach((done) => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>Mistake</p>')
done()
})
})

View File

@ -1,7 +1,9 @@
context('/api/extensions/horizontal-rule', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/horizontal-rule')
})
beforeEach(() => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>Example Text</p>')

View File

@ -1,11 +1,14 @@
context('/api/extensions/italic', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/italic')
})
beforeEach((done) => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>Example Text</p>')
editor.selectAll()
done()
})
})

View File

@ -1,10 +1,13 @@
context('/api/extensions/paragraph', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/paragraph')
})
beforeEach((done) => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.clearContent()
done()
})
})

View File

@ -1,11 +1,14 @@
context('/api/extensions/strike', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/strike')
})
beforeEach((done) => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>Example Text</p>')
editor.selectAll()
done()
})
})

View File

@ -1,11 +1,14 @@
context('/api/extensions/underline', () => {
beforeEach(() => {
before(() => {
cy.visit('/api/extensions/underline')
})
beforeEach((done) => {
cy.get('.ProseMirror').window().then(window => {
const { editor } = window
editor.setContent('<p>Example Text</p>')
editor.selectAll()
done()
})
})