2020-11-22 20:50:07 +00:00
|
|
|
/*
|
2021-01-06 20:37:59 +00:00
|
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
2020-11-22 20:50:07 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2020-07-16 09:22:53 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
2021-02-08 14:03:11 +00:00
|
|
|
describe('Intro page', () => {
|
2020-07-16 09:22:53 +00:00
|
|
|
beforeEach(() => {
|
2021-03-09 22:00:14 +00:00
|
|
|
cy.loadConfig()
|
2021-02-08 14:03:11 +00:00
|
|
|
cy.intercept('/intro.md', 'test content')
|
2020-07-16 09:22:53 +00:00
|
|
|
cy.visit('/')
|
|
|
|
})
|
|
|
|
|
2021-02-08 14:03:11 +00:00
|
|
|
describe('content', () => {
|
|
|
|
it('fetches and shows the correct intro page content', () => {
|
|
|
|
cy.getMarkdownBody()
|
|
|
|
.contains('test content')
|
2020-07-16 09:22:53 +00:00
|
|
|
})
|
2021-02-08 14:03:11 +00:00
|
|
|
})
|
2020-07-16 09:22:53 +00:00
|
|
|
|
2021-02-08 14:03:11 +00:00
|
|
|
describe('features button', () => {
|
|
|
|
it('is hidden when logged in', () => {
|
|
|
|
cy.get('[data-cy="features-button"]')
|
2020-07-16 09:22:53 +00:00
|
|
|
.should('not.exist')
|
|
|
|
})
|
|
|
|
|
2021-02-08 14:03:11 +00:00
|
|
|
it('is visible when logged out', () => {
|
2020-07-16 09:22:53 +00:00
|
|
|
cy.logout()
|
2021-02-08 14:03:11 +00:00
|
|
|
cy.get('[data-cy="features-button"]')
|
|
|
|
.should('exist')
|
2020-07-16 09:22:53 +00:00
|
|
|
})
|
2021-02-08 14:03:11 +00:00
|
|
|
})
|
2020-07-16 09:22:53 +00:00
|
|
|
|
2021-02-08 14:03:11 +00:00
|
|
|
describe('sign in button', () => {
|
|
|
|
it('is hidden when logged in', () => {
|
|
|
|
cy.get('[data-cy="sign-in-button"]')
|
|
|
|
.should('not.exist')
|
2020-07-16 09:22:53 +00:00
|
|
|
})
|
|
|
|
|
2021-02-08 14:03:11 +00:00
|
|
|
it('is visible when logged out', () => {
|
|
|
|
cy.logout()
|
|
|
|
cy.get('[data-cy="sign-in-button"]')
|
2020-07-16 09:22:53 +00:00
|
|
|
.should('exist')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
2021-02-08 14:03:11 +00:00
|
|
|
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')
|
2021-03-10 21:45:05 +00:00
|
|
|
cy.get('[data-cy="version-modal"] .modal-header .close')
|
2021-02-08 14:03:11 +00:00
|
|
|
.click()
|
|
|
|
cy.get('[data-cy="version-modal"]')
|
|
|
|
.should('not.exist')
|
|
|
|
})
|
2020-07-16 09:22:53 +00:00
|
|
|
})
|
|
|
|
})
|