2020-11-22 15:50:07 -05:00
|
|
|
/*
|
2023-06-29 16:17:03 -04:00
|
|
|
* SPDX-FileCopyrightText: 2023 The HedgeDoc developers (see AUTHORS file)
|
2020-11-22 15:50:07 -05:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2020-07-16 05:22:53 -04:00
|
|
|
/* eslint-disable @typescript-eslint/no-unsafe-call */
|
2021-02-08 09:03:11 -05:00
|
|
|
describe('Intro page', () => {
|
2020-07-16 05:22:53 -04:00
|
|
|
beforeEach(() => {
|
2023-08-12 14:07:38 -04:00
|
|
|
cy.intercept('/public/intro.md', 'test content')
|
2023-09-10 02:54:03 -04:00
|
|
|
cy.logOut()
|
2022-01-30 15:46:43 -05:00
|
|
|
cy.visitHome()
|
2020-07-16 05:22:53 -04:00
|
|
|
})
|
|
|
|
|
2021-05-03 15:56:44 -04:00
|
|
|
describe('customizable content', () => {
|
2021-02-08 09:03:11 -05:00
|
|
|
it('fetches and shows the correct intro page content', () => {
|
2023-03-16 03:20:16 -04:00
|
|
|
cy.getSimpleRendererBody().contains('test content')
|
2020-07-16 05:22:53 -04:00
|
|
|
})
|
2021-05-03 15:56:44 -04:00
|
|
|
|
2021-11-19 12:04:04 -05:00
|
|
|
it("won't show anything if no content was found", () => {
|
2023-08-12 14:07:38 -04:00
|
|
|
cy.intercept('/public/intro.md', {
|
2021-05-03 15:56:44 -04:00
|
|
|
statusCode: 404
|
|
|
|
})
|
2022-01-30 15:46:43 -05:00
|
|
|
cy.visitHome()
|
2021-05-03 15:56:44 -04:00
|
|
|
|
2021-12-25 10:44:24 -05:00
|
|
|
cy.getByCypressId('documentIframe').should('not.exist')
|
2021-05-03 15:56:44 -04:00
|
|
|
})
|
2021-02-08 09:03:11 -05:00
|
|
|
})
|
2020-07-16 05:22:53 -04:00
|
|
|
})
|