mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-24 18:21:03 +00:00
b42cb8fc49
* Update dependency cypress to v7 Signed-off-by: Renovate Bot <bot@renovateapp.com> * Use global beforeEach for config loading Signed-off-by: Erik Michelson <github@erik.michelson.eu> Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Erik Michelson <github@erik.michelson.eu>
61 lines
1.5 KiB
TypeScript
61 lines
1.5 KiB
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 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('/intro.md', 'test content')
|
|
cy.visit('/')
|
|
})
|
|
|
|
describe('content', () => {
|
|
it('fetches and shows the correct intro page content', () => {
|
|
cy.getMarkdownBody()
|
|
.contains('test content')
|
|
})
|
|
})
|
|
|
|
describe('features button', () => {
|
|
it('is hidden when logged in', () => {
|
|
cy.get('[data-cy="features-button"]')
|
|
.should('not.exist')
|
|
})
|
|
|
|
it('is visible when logged out', () => {
|
|
cy.logout()
|
|
cy.get('[data-cy="features-button"]')
|
|
.should('exist')
|
|
})
|
|
})
|
|
|
|
describe('sign in button', () => {
|
|
it('is hidden when logged in', () => {
|
|
cy.get('[data-cy="sign-in-button"]')
|
|
.should('not.exist')
|
|
})
|
|
|
|
it('is visible when logged out', () => {
|
|
cy.logout()
|
|
cy.get('[data-cy="sign-in-button"]')
|
|
.should('exist')
|
|
})
|
|
})
|
|
|
|
describe('version dialog', () => {
|
|
it('can be opened and closed', () => {
|
|
cy.get('[data-cy="version-modal"]')
|
|
.should('not.exist')
|
|
cy.get('[data-cy="show-version-modal"]')
|
|
.click()
|
|
cy.get('[data-cy="version-modal"]')
|
|
.should('be.visible')
|
|
cy.get('[data-cy="version-modal"] .modal-header .close')
|
|
.click()
|
|
cy.get('[data-cy="version-modal"]')
|
|
.should('not.exist')
|
|
})
|
|
})
|
|
})
|