mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 03:13:42 -05:00
* 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
38 lines
1.0 KiB
JavaScript
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')
|
|
});
|
|
});
|
|
});
|