mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-18 17:25:16 -04:00

This needs to be done since the backend does not include code for the history page anymore. This will be replaced with the explore page in the near future anyway. Co-authored-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Philip Molares <philip.molares@udo.edu> Signed-off-by: Erik Michelson <github@erik.michelson.eu>
33 lines
898 B
TypeScript
33 lines
898 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
import { testNoteId } from './visit-test-editor'
|
|
|
|
declare namespace Cypress {
|
|
interface Chainable {
|
|
visitTestNote(pageMode?: PAGE_MODE, query?: string): Chainable<Cypress.AUTWindow>
|
|
|
|
visitHome(): Chainable<Cypress.AUTWindow>
|
|
|
|
visitHistory(): Chainable<Cypress.AUTWindow>
|
|
}
|
|
}
|
|
|
|
Cypress.Commands.add('visitHome', () => {
|
|
return cy.visit('/', { retryOnNetworkFailure: true, retryOnStatusCodeFailure: true })
|
|
})
|
|
|
|
export enum PAGE_MODE {
|
|
EDITOR = 'n',
|
|
PRESENTATION = 'p',
|
|
DOCUMENT_READ_ONLY = 's'
|
|
}
|
|
|
|
Cypress.Commands.add('visitTestNote', (pageMode: PAGE_MODE = PAGE_MODE.EDITOR, query?: string) => {
|
|
return cy.visit(`/${pageMode}/${testNoteId}${query ? `?${query}` : ''}`, {
|
|
retryOnNetworkFailure: true,
|
|
retryOnStatusCodeFailure: true
|
|
})
|
|
})
|