Autocompletion and toolbar button for collapsable blocks (#615)

* Add autocompletion for <details construct

* Add toolbar button for <details>-construct

* Added CHANGELOG notice
This commit is contained in:
Erik Michelson 2020-09-30 23:35:10 +02:00 committed by GitHub
parent 2b6ba82b4b
commit 0f31c3b0b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 171 additions and 2 deletions

View file

@ -265,4 +265,34 @@ describe('Autocompletion', () => {
.should('exist')
})
})
describe('collapsable blocks', () => {
it('via Enter', () => {
cy.get('.CodeMirror textarea')
.type('<d')
cy.get('.CodeMirror-hints')
.should('exist')
cy.get('.CodeMirror textarea')
.type('{enter}')
cy.get('.CodeMirror-hints')
.should('not.exist')
cy.get('.CodeMirror-activeline > .CodeMirror-line > span')
.should('have.text', '</details>') // after selecting the hint, the last line of the inserted suggestion is active
cy.get('.markdown-body > details')
.should('exist')
})
it('via doubleclick', () => {
cy.get('.CodeMirror textarea')
.type('<d')
cy.get('.CodeMirror-hints > li')
.first()
.dblclick()
cy.get('.CodeMirror-hints')
.should('not.exist')
cy.get('.CodeMirror-activeline > .CodeMirror-line > span')
.should('have.text', '</details>')
cy.get('.markdown-body > details')
.should('exist')
})
})
})