hedgedoc/cypress/support/visit-test-editor.ts
Tilman Vatteroth e12dc523f8
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>
2021-02-03 22:13:04 +01:00

33 lines
750 B
TypeScript

/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
declare namespace Cypress {
interface Chainable {
visitTestEditor(query?: string): Chainable<Cypress.AUTWindow>
}
}
export const testNoteId = 'test'
Cypress.Commands.add('visitTestEditor', (query?: string) => {
return cy.visit(`/n/${ testNoteId }${ query ? `?${ query }` : '' }`)
})
beforeEach(() => {
cy.intercept(`/api/v2/notes/${ testNoteId }-get`, {
'id': 'ABC123',
'alias': 'banner',
'lastChange': {
'userId': 'test',
'timestamp': 1600033920
},
'viewCount': 0,
'createTime': 1600033920,
'content': '',
'authorship': [],
'preVersionTwoNote': true
})
})