mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04:00
Update dependency cypress to v10 (#2095)
* Update dependency cypress to v10 * Migrate cypress files Signed-off-by: Renovate Bot <bot@renovateapp.com> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
e93607c96e
commit
040e11924f
34 changed files with 57 additions and 45 deletions
60
cypress/e2e/intro.spec.ts
Normal file
60
cypress/e2e/intro.spec.ts
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
||||
describe('Intro page', () => {
|
||||
beforeEach(() => {
|
||||
cy.intercept('/mock-public/intro.md', 'test content')
|
||||
cy.visitHome()
|
||||
})
|
||||
|
||||
describe('customizable content', () => {
|
||||
it('fetches and shows the correct intro page content', () => {
|
||||
cy.getIntroBody().contains('test content')
|
||||
})
|
||||
|
||||
it("won't show anything if no content was found", () => {
|
||||
cy.intercept('/mock-public/intro.md', {
|
||||
statusCode: 404
|
||||
})
|
||||
cy.visitHome()
|
||||
|
||||
cy.getByCypressId('documentIframe').should('not.exist')
|
||||
})
|
||||
})
|
||||
|
||||
describe('features button', () => {
|
||||
it('is hidden when logged in', () => {
|
||||
cy.getByCypressId('features-button').should('not.exist')
|
||||
})
|
||||
|
||||
it('is visible when logged out', () => {
|
||||
cy.logout()
|
||||
cy.getByCypressId('features-button').should('exist')
|
||||
})
|
||||
})
|
||||
|
||||
describe('sign in button', () => {
|
||||
it('is hidden when logged in', () => {
|
||||
cy.getByCypressId('sign-in-button').should('not.exist')
|
||||
})
|
||||
|
||||
it('is visible when logged out', () => {
|
||||
cy.logout()
|
||||
cy.getByCypressId('sign-in-button').should('exist')
|
||||
})
|
||||
})
|
||||
|
||||
describe('version dialog', () => {
|
||||
it('can be opened and closed', () => {
|
||||
cy.getByCypressId('version-modal').should('not.exist')
|
||||
cy.getByCypressId('show-version-modal').click()
|
||||
cy.getByCypressId('version-modal').should('be.visible')
|
||||
cy.getByCypressId('version-modal').find('.modal-header .close').click()
|
||||
cy.getByCypressId('version-modal').should('not.exist')
|
||||
})
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue