landing-hero-fold.test.mjs
sha256:700fafdd1afa490919f9515d660ca6e75456bcd5bb67513abcd8757a634c01f6
docs: record AIP-b SD-21 land (KN #308)
Human
10 days ago
| 1 | import { describe, it } from 'node:test'; |
| 2 | import assert from 'node:assert'; |
| 3 | import { readFileSync } from 'node:fs'; |
| 4 | import { fileURLToPath } from 'node:url'; |
| 5 | import { dirname, join } from 'node:path'; |
| 6 | |
| 7 | const root = join(dirname(fileURLToPath(import.meta.url)), '..'); |
| 8 | const indexHtml = readFileSync(join(root, 'web', 'index.html'), 'utf8'); |
| 9 | |
| 10 | const foldCss = indexHtml.slice( |
| 11 | indexHtml.indexOf('/* Hero fold:'), |
| 12 | indexHtml.indexOf('footer {') |
| 13 | ); |
| 14 | |
| 15 | describe('structured-memory hero fold', () => { |
| 16 | it('does not draw a bordered elevated box around the fold', () => { |
| 17 | assert.match(foldCss, /\.hero-value-fold\s*\{[^}]*border:\s*none/s); |
| 18 | assert.match(foldCss, /\.hero-value-fold\s*\{[^}]*background:\s*transparent/s); |
| 19 | assert.doesNotMatch(foldCss, /\.hero-value-fold\s*\{[^}]*border:\s*1px solid/s); |
| 20 | }); |
| 21 | |
| 22 | it('places a larger bright-blue chevron beside the heading', () => { |
| 23 | assert.match(indexHtml, /class="hero-value-fold-chevron"/); |
| 24 | assert.match(indexHtml, /\.hero-value-fold-chevron\s*\{[^}]*font-size:\s*2\.35rem/s); |
| 25 | assert.match(indexHtml, /\.hero-value-fold-chevron\s*\{[^}]*color:\s*#4da3ff/s); |
| 26 | }); |
| 27 | |
| 28 | it('paints Ourware ecosystem links in bright cyan, including visited', () => { |
| 29 | assert.match( |
| 30 | indexHtml, |
| 31 | /\.ecosystem-vision-lead a:visited[\s\S]*?color:\s*#7dd3fc/ |
| 32 | ); |
| 33 | }); |
| 34 | |
| 35 | it('draws three progressively shorter lines under the heading', () => { |
| 36 | assert.match(indexHtml, /class="hero-value-fold-triangle"/); |
| 37 | assert.match(indexHtml, /\.hero-value-fold-triangle span:nth-child\(1\) \{ width: 8\.25rem; \}/); |
| 38 | assert.match(indexHtml, /\.hero-value-fold-triangle span:nth-child\(2\) \{ width: 5\.15rem; \}/); |
| 39 | assert.match(indexHtml, /\.hero-value-fold-triangle span:nth-child\(3\) \{ width: 2\.35rem; \}/); |
| 40 | }); |
| 41 | }); |
File History
1 commit
sha256:700fafdd1afa490919f9515d660ca6e75456bcd5bb67513abcd8757a634c01f6
docs: record AIP-b SD-21 land (KN #308)
Human
10 days ago