2020-11-22 15:50:07 -05:00
|
|
|
/*
|
2021-01-06 15:37:59 -05:00
|
|
|
* SPDX-FileCopyrightText: 2021 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
|
|
|
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')
|
|
|
|
})
|
|
|
|
})
|