mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-27 13:34:28 -04:00
fix(frontend): fix motd e2e test
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
dd4e50103f
commit
dfbd45301c
6 changed files with 31 additions and 9 deletions
|
@ -4,19 +4,20 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
const MOTD_LOCAL_STORAGE_KEY = 'motd.lastModified'
|
||||
import { MOTD_LOCAL_STORAGE_KEY } from '../../src/components/global-dialogs/motd-modal/local-storage-keys'
|
||||
|
||||
const motdMockHtml = 'This is the test motd text'
|
||||
|
||||
describe('Motd', () => {
|
||||
it("shows, dismisses and won't show again a motd modal", () => {
|
||||
localStorage.removeItem(MOTD_LOCAL_STORAGE_KEY)
|
||||
window.localStorage.removeItem(MOTD_LOCAL_STORAGE_KEY)
|
||||
|
||||
cy.visitHistory()
|
||||
cy.getSimpleRendererBody().should('contain.text', motdMockHtml)
|
||||
cy.getByCypressId('motd-dismiss')
|
||||
.click()
|
||||
.then(() => {
|
||||
expect(localStorage.getItem(MOTD_LOCAL_STORAGE_KEY)).not.to.be.eq(null)
|
||||
expect(window.localStorage.getItem(MOTD_LOCAL_STORAGE_KEY)).not.to.be.eq(null)
|
||||
})
|
||||
cy.getByCypressId('motd-modal').should('not.exist')
|
||||
cy.reload()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue