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
|
|
|
import { banner } from '../support/config'
|
|
|
|
|
|
|
|
describe('Banner', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.visit('/')
|
|
|
|
expect(localStorage.getItem('bannerTimeStamp')).to.be.null
|
|
|
|
})
|
|
|
|
|
|
|
|
it('shows the correct alert banner text', () => {
|
|
|
|
cy.get('.alert-primary.show')
|
|
|
|
.contains(banner.text)
|
|
|
|
})
|
|
|
|
|
|
|
|
it('can be dismissed', () => {
|
|
|
|
cy.get('.alert-primary.show')
|
|
|
|
.contains(banner.text)
|
|
|
|
cy.get('.alert-primary.show')
|
|
|
|
.find('.fa-times')
|
|
|
|
.click()
|
|
|
|
.then(() => {
|
2021-02-03 21:13:04 +00:00
|
|
|
expect(localStorage.getItem('bannerTimeStamp'))
|
|
|
|
.to
|
|
|
|
.equal(banner.timestamp)
|
2020-07-16 09:22:53 +00:00
|
|
|
})
|
|
|
|
cy.get('.alert-primary.show')
|
|
|
|
.should('not.exist')
|
|
|
|
})
|
|
|
|
})
|