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:
Tilman Vatteroth 2021-02-03 22:13:04 +01:00 committed by GitHub
parent 0180c75e55
commit e12dc523f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
301 changed files with 4393 additions and 3741 deletions

View file

@ -11,8 +11,9 @@ declare namespace Cypress {
* Custom command to fill an input field with text and trigger a change event.
* @example cy.get(input).fill('content')
*/
fill (value: string): Chainable<Element>
codemirrorFill (value: string): Chainable<Element>
fill(value: string): Chainable<Element>
codemirrorFill(value: string): Chainable<Element>
}
}
@ -20,17 +21,18 @@ Cypress.Commands.add('fill', {
prevSubject: 'element'
}, (subject, value) => {
return cy.wrap(subject)
.invoke('val', value)
.trigger('change', { force: true })
.invoke('val', value)
.trigger('change', { force: true })
})
Cypress.Commands.add('codemirrorFill', (content: string) => {
const line = content.split("\n").find(value => value !== '');
const line = content.split('\n')
.find(value => value !== '')
cy.get('.CodeMirror')
.click()
.get('textarea')
.fill(content)
if(line) {
if (line) {
cy.get('.CodeMirror')
.contains('.CodeMirror-line', line)
}