2021-02-01 21:55:49 +00: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 21:13:04 +00:00
|
|
|
visitTestEditor(query?: string): Chainable<Cypress.AUTWindow>
|
2021-02-01 21:55:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export const testNoteId = 'test'
|
|
|
|
|
|
|
|
Cypress.Commands.add('visitTestEditor', (query?: string) => {
|
2021-02-03 21:13:04 +00:00
|
|
|
return cy.visit(`/n/${ testNoteId }${ query ? `?${ query }` : '' }`)
|
2021-02-01 21:55:49 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
beforeEach(() => {
|
2021-05-02 20:38:43 +00:00
|
|
|
cy.intercept(`/mock-backend/api/private/notes/${ testNoteId }-get`, {
|
2021-05-01 21:01:42 +00:00
|
|
|
"content": "",
|
|
|
|
"metadata": {
|
2021-10-09 17:09:29 +00:00
|
|
|
"id": "mock_note_id",
|
|
|
|
"alias": "mockNote",
|
2021-05-01 21:01:42 +00:00
|
|
|
"version": 2,
|
|
|
|
"viewCount": 0,
|
|
|
|
"updateTime": "2021-04-24T09:27:51.000Z",
|
|
|
|
"updateUser": {
|
|
|
|
"userName": "test",
|
|
|
|
"displayName": "Testy",
|
|
|
|
"photo": "",
|
|
|
|
"email": ""
|
|
|
|
},
|
|
|
|
"createTime": "2021-04-24T09:27:51.000Z",
|
|
|
|
"editedBy": []
|
|
|
|
}
|
2021-02-01 21:55:49 +00:00
|
|
|
})
|
|
|
|
})
|