mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00
Cypress-IDs and prettier for tests (#1634)
* Add cy.getById method and run prettier Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
parent
8a8bacc0aa
commit
d725b65140
53 changed files with 758 additions and 1203 deletions
|
@ -13,26 +13,26 @@ declare namespace Cypress {
|
|||
export const testNoteId = 'test'
|
||||
|
||||
Cypress.Commands.add('visitTestEditor', (query?: string) => {
|
||||
return cy.visit(`/n/${ testNoteId }${ query ? `?${ query }` : '' }`)
|
||||
return cy.visit(`/n/${testNoteId}${query ? `?${query}` : ''}`)
|
||||
})
|
||||
|
||||
beforeEach(() => {
|
||||
cy.intercept(`/mock-backend/api/private/notes/${ testNoteId }-get`, {
|
||||
"content": "",
|
||||
"metadata": {
|
||||
"id": "mock_note_id",
|
||||
"alias": "mockNote",
|
||||
"version": 2,
|
||||
"viewCount": 0,
|
||||
"updateTime": "2021-04-24T09:27:51.000Z",
|
||||
"updateUser": {
|
||||
"userName": "test",
|
||||
"displayName": "Testy",
|
||||
"photo": "",
|
||||
"email": ""
|
||||
cy.intercept(`/mock-backend/api/private/notes/${testNoteId}-get`, {
|
||||
content: '',
|
||||
metadata: {
|
||||
id: 'mock_note_id',
|
||||
alias: 'mockNote',
|
||||
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": []
|
||||
createTime: '2021-04-24T09:27:51.000Z',
|
||||
editedBy: []
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue