mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-21 10:45:20 -04:00
made the addCodeFences function also work without selections (#428)
* made the addCodeFences function also work without selections changed tests accordingly * add codeFence change in CHANGELOG.md
This commit is contained in:
parent
5a56784cd0
commit
13b7854c65
4 changed files with 91 additions and 17 deletions
|
@ -85,18 +85,48 @@ describe('Toolbar', () => {
|
|||
.should('have.text', `## ${testText}`)
|
||||
})
|
||||
|
||||
it('code', () => {
|
||||
cy.get('.CodeMirror textarea')
|
||||
.type(`${testText}`)
|
||||
.type('{ctrl}a')
|
||||
cy.get('.fa-code')
|
||||
.click()
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line > span > span')
|
||||
.should('have.text', '```')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(2) > .CodeMirror-line > span span')
|
||||
.should('have.text', testText)
|
||||
cy.get('.CodeMirror-code > div.CodeMirror-activeline > .CodeMirror-line > span span')
|
||||
.should('have.text', '```')
|
||||
describe('code', () => {
|
||||
it('nothing selected empty line', () => {
|
||||
cy.get('.CodeMirror textarea')
|
||||
.type(`${testText}`)
|
||||
.type('{ctrl}a')
|
||||
.type('{backspace}')
|
||||
cy.get('.fa-code')
|
||||
.click()
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line > span > span')
|
||||
.should('have.text', '```')
|
||||
cy.get('.CodeMirror-code > div.CodeMirror-activeline > .CodeMirror-line > span span')
|
||||
.should('have.text', '```')
|
||||
})
|
||||
|
||||
it('nothing selected non line', () => {
|
||||
cy.get('.CodeMirror textarea')
|
||||
.type(`${testText}`)
|
||||
.type('{ctrl}a')
|
||||
.type('{leftArrow}')
|
||||
cy.get('.fa-code')
|
||||
.click()
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line > span > span')
|
||||
.should('have.text', '```')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(2) > .CodeMirror-line > span span')
|
||||
.should('have.text', testText)
|
||||
cy.get('.CodeMirror-code > div.CodeMirror-activeline > .CodeMirror-line > span span')
|
||||
.should('have.text', '```')
|
||||
})
|
||||
|
||||
it('line selected', () => {
|
||||
cy.get('.CodeMirror textarea')
|
||||
.type(`${testText}`)
|
||||
.type('{ctrl}a')
|
||||
cy.get('.fa-code')
|
||||
.click()
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(1) > .CodeMirror-line > span > span')
|
||||
.should('have.text', '```')
|
||||
cy.get('.CodeMirror-code > div:nth-of-type(2) > .CodeMirror-line > span span')
|
||||
.should('have.text', testText)
|
||||
cy.get('.CodeMirror-code > div.CodeMirror-activeline > .CodeMirror-line > span span')
|
||||
.should('have.text', '```')
|
||||
})
|
||||
})
|
||||
|
||||
it('quote', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue