Files
notifications-admin/tests/javascripts/errorBanner.test.js
Jonathan Bobel e0d2d74067 Update dashboard and template flow (#514)
* Updated header and footer
* Moved files around and updated gulpfile to correct the build process when it goes to production
* Updated fonts
* Adjusted grid templating
* Adding images to assets
* Updated account pages, dashboard, and pages in message sending flow
* Updated the styling for the landing pages in the account section once logged in
2023-06-08 13:12:00 -04:00

38 lines
1.0 KiB
JavaScript

beforeAll(() => {
require('../../app/assets/javascripts/errorBanner.js')
});
afterAll(() => {
require('./support/teardown.js');
});
describe("Error Banner", () => {
afterEach(() => {
document.body.innerHTML = '';
});
describe("The `hideBanner` method", () => {
test("Will hide the element", () => {
document.body.innerHTML = `
<span class="usa-error-message banner-dangerous js-error-visible">
</span>`;
window.GOVUK.ErrorBanner.hideBanner();
expect(document.querySelector('.banner-dangerous').classList).toContain('govuk-!-display-none')
});
});
describe("The `showBanner` method", () => {
beforeEach(() => {
document.body.innerHTML = `
<span class="usa-error-message banner-dangerous js-error-visible govuk-!-display-none">
</span>`;
window.GOVUK.ErrorBanner.showBanner('Some Err');
});
test("Will show the element", () => {
expect(document.querySelector('.banner-dangerous').classList).not.toContain('govuk-!-display-none')
});
});
});