landing-family-integration.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, existsSync } 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 ecosystemStart = indexHtml.indexOf('id="ecosystem-vision-heading"'); |
| 11 | const ecosystemEnd = indexHtml.indexOf('id="structured-memory-main"'); |
| 12 | const ecosystem = indexHtml.slice(ecosystemStart, ecosystemEnd); |
| 13 | const footer = indexHtml.slice(indexHtml.lastIndexOf('<footer>')); |
| 14 | |
| 15 | describe('landing family placement (integration)', () => { |
| 16 | it('opens ecosystem vision with Ourware and the Knowtation brain role', () => { |
| 17 | assert.ok(ecosystemStart !== -1 && ecosystemEnd > ecosystemStart); |
| 18 | assert.match(ecosystem, /ecosystem-vision-lead/); |
| 19 | const leadStart = ecosystem.indexOf('class="ecosystem-vision-lead"'); |
| 20 | const lead = ecosystem.slice(leadStart, ecosystem.indexOf('</p>', leadStart)); |
| 21 | assert.match(lead, /Ourware/); |
| 22 | assert.match(lead, /https:\/\/ourware\.org/); |
| 23 | assert.match(lead, /brain/i); |
| 24 | assert.ok(lead.indexOf('Ourware') < lead.toLowerCase().indexOf('brain')); |
| 25 | }); |
| 26 | |
| 27 | it('puts scool.ing in the architecture flow and Overseer Kit in technical details', () => { |
| 28 | assert.match(ecosystem, /ecosystem-flow-node">scool\.ing/); |
| 29 | assert.doesNotMatch(ecosystem, /ecosystem-flow-node">AgentCeption/); |
| 30 | const details = ecosystem.slice(ecosystem.indexOf('Technical details and links')); |
| 31 | assert.match(details, /<strong>Overseer Kit<\/strong>/); |
| 32 | assert.match(details, /https:\/\/github\.com\/aaronrene\/overseer-kit/); |
| 33 | assert.match(details, /<strong>scool\.ing<\/strong>/); |
| 34 | assert.match(details, /https:\/\/scool\.ing/); |
| 35 | }); |
| 36 | |
| 37 | it('does not put the family presence band under the Ecosystem visions title', () => { |
| 38 | const heading = ecosystem.indexOf('Ecosystem visions'); |
| 39 | const lead = ecosystem.indexOf('class="ecosystem-vision-lead"'); |
| 40 | const between = ecosystem.slice(heading, lead); |
| 41 | assert.ok(heading !== -1 && lead > heading); |
| 42 | assert.doesNotMatch(between, /family-presence-band/); |
| 43 | }); |
| 44 | |
| 45 | it('places a black family presence section after Ecosystem visions with theBRAIN image', () => { |
| 46 | const ecoClose = indexHtml.indexOf('</section>', indexHtml.indexOf('id="ecosystem-vision-heading"')); |
| 47 | const band = indexHtml.indexOf('class="family-presence-band"'); |
| 48 | const memory = indexHtml.indexOf('id="structured-memory-main"'); |
| 49 | assert.ok(ecoClose !== -1 && band > ecoClose && memory > band); |
| 50 | const bandHtml = indexHtml.slice(band, memory); |
| 51 | assert.match(bandHtml, /class="brain-grow-show"/); |
| 52 | assert.match(bandHtml, /Many Ways to Grow/); |
| 53 | assert.equal((bandHtml.match(/class="brain-grow-show__slide[^"]*"/g) || []).length, 10); |
| 54 | assert.equal((bandHtml.match(/class="brain-grow-show__dot"/g) || []).length, 10); |
| 55 | assert.match(bandHtml, /Private at the desk/); |
| 56 | assert.match(bandHtml, /src="\/assets\/thebrain-show\/privacy-local-desk\.webp"/); |
| 57 | assert.match(bandHtml, /scool\.ing/); |
| 58 | assert.match(bandHtml, /control panel/); |
| 59 | assert.match(bandHtml, /theBRAIN/); |
| 60 | assert.match(bandHtml, /spaces and presence/); |
| 61 | assert.match(bandHtml, /Ourware/); |
| 62 | assert.doesNotMatch(bandHtml, /\bschooling\b/i); |
| 63 | const showDir = join(root, 'web', 'assets', 'thebrain-show'); |
| 64 | const expected = [ |
| 65 | 'models-lineup-sensors.webp', |
| 66 | 'tech-exploded-dual-cam.webp', |
| 67 | 'privacy-local-desk.webp', |
| 68 | 'models-movable-vision-coverage.webp', |
| 69 | 'tech-sensor-addons.webp', |
| 70 | 'privacy-team-posture.webp', |
| 71 | 'tech-exploded-internals.webp', |
| 72 | 'usecase-adult-second-brain.webp', |
| 73 | 'models-brain-pro-max-omni.webp', |
| 74 | 'privacy-shared-room.webp', |
| 75 | ]; |
| 76 | for (const name of expected) { |
| 77 | assert.ok(existsSync(join(showDir, name)), name); |
| 78 | } |
| 79 | }); |
| 80 | |
| 81 | it('closes the page with a white Ourware family line, rings mark, and Ourware socials', () => { |
| 82 | const familyIdx = footer.indexOf('class="footer-family"'); |
| 83 | const linksIdx = footer.indexOf('class="footer-links"'); |
| 84 | const ourwareSocialIdx = footer.indexOf('class="footer-ourware-social"'); |
| 85 | assert.ok(familyIdx !== -1 && linksIdx !== -1 && familyIdx > linksIdx); |
| 86 | assert.ok(ourwareSocialIdx !== -1 && ourwareSocialIdx > familyIdx); |
| 87 | assert.match(footer, /class="footer-family-link"/); |
| 88 | assert.match(footer, /class="ourware-mark"/); |
| 89 | assert.match(footer, /Ourware/); |
| 90 | assert.match(footer, /https:\/\/www\.facebook\.com\/profile\.php\?id=61593821631787/); |
| 91 | assert.match(footer, /https:\/\/www\.linkedin\.com\/company\/143378951/); |
| 92 | assert.match(footer, /https:\/\/www\.youtube\.com\/channel\/UC85lDAayTYjkqPFOyDaORWA/); |
| 93 | assert.match(footer, /https:\/\/x\.com\/ourware/); |
| 94 | assert.match(indexHtml, /footer \.footer-family-link[\s\S]*?color:\s*#ffffff/); |
| 95 | }); |
| 96 | }); |
File History
1 commit
sha256:700fafdd1afa490919f9515d660ca6e75456bcd5bb67513abcd8757a634c01f6
docs: record AIP-b SD-21 land (KN #308)
Human
10 days ago