landing-family-e2e.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 { createServer } from 'node:http'; |
| 4 | import { readFileSync } from 'node:fs'; |
| 5 | import { fileURLToPath } from 'node:url'; |
| 6 | import { dirname, join } from 'node:path'; |
| 7 | |
| 8 | const root = join(dirname(fileURLToPath(import.meta.url)), '..'); |
| 9 | const indexPath = join(root, 'web', 'index.html'); |
| 10 | |
| 11 | function serveIndex() { |
| 12 | const html = readFileSync(indexPath); |
| 13 | return new Promise((resolve) => { |
| 14 | const server = createServer((req, res) => { |
| 15 | res.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' }); |
| 16 | res.end(html); |
| 17 | }); |
| 18 | server.listen(0, '127.0.0.1', () => { |
| 19 | const { port } = server.address(); |
| 20 | resolve({ server, url: `http://127.0.0.1:${port}/` }); |
| 21 | }); |
| 22 | }); |
| 23 | } |
| 24 | |
| 25 | describe('landing family page (e2e)', () => { |
| 26 | it('serves the landing HTML with family markers and no AgentCeption', async () => { |
| 27 | const { server, url } = await serveIndex(); |
| 28 | try { |
| 29 | const res = await fetch(url); |
| 30 | assert.equal(res.status, 200); |
| 31 | const body = await res.text(); |
| 32 | assert.match(body, /Structured memory for humans and agents/); |
| 33 | assert.match(body, /class="hero-value-fold-triangle"/); |
| 34 | assert.match(body, /class="hero-value-fold-chevron"/); |
| 35 | assert.match(body, /Ourware/); |
| 36 | assert.match(body, /https:\/\/ourware\.org/); |
| 37 | assert.match(body, /scool\.ing/); |
| 38 | assert.match(body, /theBRAIN/); |
| 39 | assert.match(body, /class="family-presence-band"/); |
| 40 | assert.match(body, /class="brain-grow-show"/); |
| 41 | assert.match(body, /Many Ways to Grow/); |
| 42 | assert.match(body, /src="\/assets\/thebrain-show\/privacy-local-desk\.webp"/); |
| 43 | assert.match(body, /Overseer Kit/); |
| 44 | assert.match(body, /class="footer-ourware-social"/); |
| 45 | assert.equal(/agentception/i.test(body), false); |
| 46 | assert.equal(/parentier/i.test(body), false); |
| 47 | } finally { |
| 48 | server.close(); |
| 49 | } |
| 50 | }); |
| 51 | }); |
File History
1 commit
sha256:700fafdd1afa490919f9515d660ca6e75456bcd5bb67513abcd8757a634c01f6
docs: record AIP-b SD-21 land (KN #308)
Human
10 days ago