mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 02:05:21 -04:00
Feature/browserstack (#902)
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
parent
900affeac2
commit
887c3b9dd3
16 changed files with 404 additions and 86 deletions
|
@ -41,9 +41,6 @@ describe('Upload', () => {
|
|||
link: imageUrl
|
||||
}
|
||||
})
|
||||
cy.fixture('acme.png').then(image => {
|
||||
this.image = image
|
||||
})
|
||||
})
|
||||
it('via button', () => {
|
||||
cy.get('.fa-upload')
|
||||
|
@ -55,27 +52,31 @@ describe('Upload', () => {
|
|||
})
|
||||
|
||||
it('via paste', () => {
|
||||
const pasteEvent = {
|
||||
clipboardData: {
|
||||
files: [Cypress.Blob.base64StringToBlob(this.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')
|
||||
cy.get('.CodeMirror-scroll').trigger('paste', pasteEvent)
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span')
|
||||
.should('have.text', ``)
|
||||
})
|
||||
})
|
||||
|
||||
it('via drag and drop', () => {
|
||||
const dropEvent = {
|
||||
dataTransfer: {
|
||||
files: [Cypress.Blob.base64StringToBlob(this.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')
|
||||
cy.get('.CodeMirror-scroll').trigger('dragenter', dropEvent)
|
||||
cy.get('.CodeMirror-scroll').trigger('drop', dropEvent)
|
||||
cy.get('.CodeMirror-activeline > .CodeMirror-line > span')
|
||||
.should('have.text', ``)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue