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