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(() => {
|
|
|
|
expect(localStorage.getItem('bannerTimeStamp')).to.equal(banner.timestamp)
|
|
|
|
})
|
|
|
|
cy.get('.alert-primary.show')
|
|
|
|
.should('not.exist')
|
|
|
|
})
|
|
|
|
})
|