mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 19:47:03 -04:00
fix: Move content into to frontend directory
Doing this BEFORE the merge prevents a lot of merge conflicts. Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
4e18ce38f3
commit
762a0a850e
1051 changed files with 0 additions and 35 deletions
37
frontend/cypress/e2e/motd.spec.ts
Normal file
37
frontend/cypress/e2e/motd.spec.ts
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
const MOTD_LOCAL_STORAGE_KEY = 'motd.lastModified'
|
||||
const MOCK_LAST_MODIFIED = 'mockETag'
|
||||
const motdMockContent = 'This is the **mock** Motd call'
|
||||
const motdMockHtml = 'This is the <strong>mock</strong> Motd call'
|
||||
|
||||
describe('Motd', () => {
|
||||
it("shows, dismisses and won't show again a motd modal", () => {
|
||||
localStorage.removeItem(MOTD_LOCAL_STORAGE_KEY)
|
||||
cy.intercept('GET', 'public/motd.md', {
|
||||
statusCode: 200,
|
||||
headers: { 'Last-Modified': MOCK_LAST_MODIFIED },
|
||||
body: motdMockContent
|
||||
})
|
||||
|
||||
cy.intercept('HEAD', 'public/motd.md', {
|
||||
statusCode: 200,
|
||||
headers: { 'Last-Modified': MOCK_LAST_MODIFIED }
|
||||
})
|
||||
cy.visitHome()
|
||||
cy.getMotdBody().should('contain.html', motdMockHtml)
|
||||
cy.getByCypressId('motd-dismiss')
|
||||
.click()
|
||||
.then(() => {
|
||||
expect(localStorage.getItem(MOTD_LOCAL_STORAGE_KEY)).to.equal(MOCK_LAST_MODIFIED)
|
||||
})
|
||||
cy.getByCypressId('motd-modal').should('not.exist')
|
||||
cy.reload()
|
||||
cy.get('main').should('exist')
|
||||
cy.getByCypressId('motd-modal').should('not.exist')
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue