mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
Adjust editor config (#976)
* Adjust editor config Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de> Co-authored-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
0180c75e55
commit
e12dc523f8
301 changed files with 4393 additions and 3741 deletions
|
@ -45,35 +45,40 @@ describe('File upload', () => {
|
|||
cy.get('div.btn-group > input[type=file]')
|
||||
.attachFile({ filePath: 'acme.png', mimeType: 'image/png' })
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span')
|
||||
.should('have.text', ``)
|
||||
.should('have.text', ``)
|
||||
})
|
||||
|
||||
it('via paste', () => {
|
||||
cy.fixture('acme.png').then((image: string) => {
|
||||
const pasteEvent = {
|
||||
clipboardData: {
|
||||
files: [Cypress.Blob.base64StringToBlob(image, 'image/png')]
|
||||
cy.fixture('acme.png')
|
||||
.then((image: string) => {
|
||||
const pasteEvent = {
|
||||
clipboardData: {
|
||||
files: [Cypress.Blob.base64StringToBlob(image, 'image/png')]
|
||||
}
|
||||
}
|
||||
}
|
||||
cy.get('.CodeMirror-scroll').trigger('paste', pasteEvent)
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span')
|
||||
.should('have.text', ``)
|
||||
})
|
||||
cy.get('.CodeMirror-scroll')
|
||||
.trigger('paste', pasteEvent)
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span')
|
||||
.should('have.text', ``)
|
||||
})
|
||||
})
|
||||
|
||||
it('via drag and drop', () => {
|
||||
cy.fixture('acme.png').then((image: string) => {
|
||||
const dropEvent = {
|
||||
dataTransfer: {
|
||||
files: [Cypress.Blob.base64StringToBlob(image, 'image/png')],
|
||||
effectAllowed: 'uninitialized'
|
||||
cy.fixture('acme.png')
|
||||
.then((image: string) => {
|
||||
const dropEvent = {
|
||||
dataTransfer: {
|
||||
files: [Cypress.Blob.base64StringToBlob(image, 'image/png')],
|
||||
effectAllowed: 'uninitialized'
|
||||
}
|
||||
}
|
||||
}
|
||||
cy.get('.CodeMirror-scroll').trigger('dragenter', dropEvent)
|
||||
cy.get('.CodeMirror-scroll').trigger('drop', dropEvent)
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span')
|
||||
.should('have.text', ``)
|
||||
})
|
||||
cy.get('.CodeMirror-scroll')
|
||||
.trigger('dragenter', dropEvent)
|
||||
cy.get('.CodeMirror-scroll')
|
||||
.trigger('drop', dropEvent)
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span')
|
||||
.should('have.text', ``)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -86,10 +91,11 @@ describe('File upload', () => {
|
|||
})
|
||||
cy.get('.fa-upload')
|
||||
.click()
|
||||
cy.fixture('acme.png').then(() => {
|
||||
cy.get('input[type=file]')
|
||||
.attachFile({ filePath: 'acme.png', mimeType: 'image/png' })
|
||||
})
|
||||
cy.fixture('acme.png')
|
||||
.then(() => {
|
||||
cy.get('input[type=file]')
|
||||
.attachFile({ filePath: 'acme.png', mimeType: 'image/png' })
|
||||
})
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span > span')
|
||||
.should('have.text', String.fromCharCode(8203)) //thanks codemirror....
|
||||
})
|
||||
|
@ -101,8 +107,9 @@ describe('File upload', () => {
|
|||
getData: (type = 'text') => testText
|
||||
}
|
||||
}
|
||||
cy.get('.CodeMirror-scroll').trigger('paste', pasteEvent)
|
||||
cy.get('.CodeMirror-scroll')
|
||||
.trigger('paste', pasteEvent)
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span')
|
||||
.should('have.text', `${testText}`)
|
||||
.should('have.text', `${ testText }`)
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue