add content to the extensions overview, improve the basic example
This commit is contained in:
@@ -7,6 +7,7 @@ context('basic', () => {
|
||||
it('should return html', () => {
|
||||
cy.get('.ProseMirror').window().then(window => {
|
||||
const { editor } = window
|
||||
editor.setContent('<p>foo</p>')
|
||||
const html = editor.html()
|
||||
|
||||
expect(html).to.equal('<p>foo</p>')
|
||||
@@ -16,6 +17,7 @@ context('basic', () => {
|
||||
it('should return json', () => {
|
||||
cy.get('.ProseMirror').window().then(window => {
|
||||
const { editor } = window
|
||||
editor.setContent('<p>foo</p>')
|
||||
const json = editor.json()
|
||||
|
||||
expect(json).to.deep.equal({
|
||||
@@ -60,6 +62,7 @@ context('basic', () => {
|
||||
it('should prepend', () => {
|
||||
cy.get('.ProseMirror').window().then(window => {
|
||||
const { editor } = window
|
||||
editor.setContent('<p>foo</p>')
|
||||
|
||||
editor.focus('start').insertHTML('<p>bar</p>')
|
||||
cy.get('.ProseMirror p:first').should('contain', 'bar').should('not.contain', 'foo')
|
||||
@@ -70,6 +73,7 @@ context('basic', () => {
|
||||
it('should append', () => {
|
||||
cy.get('.ProseMirror').window().then(window => {
|
||||
const { editor } = window
|
||||
editor.setContent('<p>foo</p>')
|
||||
|
||||
editor.focus('end').insertHTML('<p>bar</p>')
|
||||
cy.get('.ProseMirror p:first').should('contain', 'foo').should('not.contain', 'bar')
|
||||
|
||||
Reference in New Issue
Block a user