clean up the markdown shortcuts tests

This commit is contained in:
Hans Pagel
2020-09-10 11:23:54 +02:00
parent e17f1b6b4b
commit 19a5e7eab5

View File

@@ -10,117 +10,91 @@ context('/examples/markdown-shortcuts', () => {
describe('headlines', () => { describe('headlines', () => {
it('should make a h1', () => { it('should make a h1', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('# Headline', {force: true})
.type('# Headline', {force: true}) .contains('h1', 'Headline')
.contains('h1', 'Headline')
})
}) })
it('should make a h2', () => { it('should make a h2', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('## Headline', {force: true})
.type('## Headline', {force: true}) .contains('h2', 'Headline')
.contains('h2', 'Headline')
})
}) })
it('should make a h3', () => { it('should make a h3', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('### Headline', {force: true})
.type('### Headline', {force: true}) .contains('h3', 'Headline')
.contains('h3', 'Headline')
})
}) })
it('should make a h4', () => { it('should make a h4', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('#### Headline', {force: true})
.type('#### Headline', {force: true}) .contains('h4', 'Headline')
.contains('h4', 'Headline')
})
}) })
it('should make a h5', () => { it('should make a h5', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('##### Headline', {force: true})
.type('##### Headline', {force: true}) .contains('h5', 'Headline')
.contains('h5', 'Headline')
})
}) })
it('should make a h6', () => { it('should make a h6', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('###### Headline', {force: true})
.type('###### Headline', {force: true}) .contains('h6', 'Headline')
.contains('h6', 'Headline')
})
}) })
}) })
describe('code', () => { describe('code', () => {
it('should create inline code', () => { it('should create inline code', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('`$foobar`', {force: true})
.type('`$foobar`', {force: true}) .contains('code', '$foobar')
.contains('code', '$foobar')
})
}) })
}) })
describe('code block', () => { describe('code block', () => {
it.skip('should create a code block without language', () => { it.skip('should create a code block without language', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('``` {enter}const foo = bar{enter}```', {force: true})
.type('``` {enter}const foo = bar{enter}```', {force: true}) .contains('pre', 'const foo = bar')
.contains('pre', 'const foo = bar')
})
}) })
}) })
describe('bullet list', () => { describe('bullet list', () => {
it.skip('should create a bullet list from asteriks', () => { it.skip('should create a bullet list from asteriks', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('* foobar', {force: true})
.type('* foobar', {force: true}) .contains('ul', 'foobar')
.contains('ul', 'foobar')
})
}) })
it.skip('should create a bullet list from dashes', () => { it.skip('should create a bullet list from dashes', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('- foobar', {force: true})
.type('- foobar', {force: true}) .contains('ul', 'foobar')
.contains('ul', 'foobar')
})
}) })
it.skip('should create a bullet list from pluses', () => { it.skip('should create a bullet list from pluses', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('+ foobar', {force: true})
.type('+ foobar', {force: true}) .contains('ul', 'foobar')
.contains('ul', 'foobar')
})
}) })
}) })
describe('ordered list', () => { describe('ordered list', () => {
it.skip('should create a ordered list', () => { it.skip('should create a ordered list', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('1. foobar', {force: true})
.type('1. foobar', {force: true}) .contains('ol', 'foobar')
.contains('ol', 'foobar')
})
}) })
}) })
describe('blockquote', () => { describe('blockquote', () => {
it.skip('should create a blockquote', () => { it.skip('should create a blockquote', () => {
cy.get('.ProseMirror').window().then(window => { cy.get('.ProseMirror')
cy.get('.ProseMirror') .type('> foobar', {force: true})
.type('> foobar', {force: true}) .contains('blockquote', 'foobar')
.contains('blockquote', 'foobar')
})
}) })
}) })
}) })