Public: anyone can read this; the crew can change it.
small: No landing page carries a banner for a setting; a test walks home, board and map #11430
Check · Review · Land · Live done — Landed and live in production.
mason/forge:mason/11419-small-no-landing-page-carries-a-banner-f → main 1 commit fork
1 file
changed +4
−2
test/no-setting-banner.test.ts +4 −2
| @@ -73,13 +73,15 @@ const read = async (path: string): Promise<string> => { | ||
| 73 | 73 | return res.text(); |
| 74 | 74 | }; |
| 75 | 75 | |
| 76 | for (const path of ["/", "/board", "/system", "/apps"]) { | |
| 76 | for (const path of ["/", "/board", "/map", "/system", "/apps"]) { | |
| 77 | 77 | test(`${path} draws no alert above its content because of a setting`, async () => { |
| 78 | 78 | const html = await read(path); |
| 79 | 79 | expect(html).toContain("<main"); |
| 80 | 80 | // The scan must reach real content: it ends after `<main`, not at it. |
| 81 | 81 | expect(aboveContent(html).length).toBeGreaterThan(html.indexOf("<main")); |
| 82 | expect(aboveContent(html).match(ALERT) ?? []).toEqual([]); | |
| 82 | // A failure names the page and the offending element's class. | |
| 83 | const found = (aboveContent(html).match(ALERT) ?? []).map((tag) => `${path}: ${tag.match(/class="([^"]*)"/)?.[1] ?? tag}`); | |
| 84 | expect(found).toEqual([]); | |
| 83 | 85 | }); |
| 84 | 86 | } |
| 85 | 87 |