mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-04-21 01:31:01 -04:00
hard-code html error message for errorBanner
turns out that we're only using errorBanner with a static message, and it's also full of rich html content. This means that it's probably better to put it in the html templates with other content, rather than hidden away in js files if we can help it. Since there are two places, had to dupe the error message but i think that's fine as i don't anticipate this error message being used in significantly more places. making it a string is a bit gross and means we don't get nice syntax highlighting on it, but as it needs to be passed in to a jinja macro that's the way it has to go unfortunately.
This commit is contained in:
@@ -30,10 +30,6 @@ describe("Error Banner", () => {
|
||||
window.GOVUK.ErrorBanner.showBanner('Some Err');
|
||||
});
|
||||
|
||||
test("Will set a specific error message on the element", () => {
|
||||
expect(document.querySelector('.banner-dangerous').textContent).toEqual('Error: Some Err')
|
||||
});
|
||||
|
||||
test("Will show the element", () => {
|
||||
expect(document.querySelector('.banner-dangerous').classList).not.toContain('govuk-!-display-none')
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user