landing-band-b.test.mjs
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd
feat(calendar): enforce agent context tiers in retrieval AP…
Human
minor
⚠ breaking
1 day 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 hubPath = 'href="/hub/"'; |
| 11 | const selfHostAnchor = |
| 12 | 'href="https://github.com/aaronrene/knowtation/blob/main/docs/TWO-PATHS-HOSTED-AND-SELF-HOSTED.md#quick-start-self-hosted"'; |
| 13 | const aiAssistedSetup = |
| 14 | 'href="https://github.com/aaronrene/knowtation/blob/main/docs/AI-ASSISTED-SETUP.md"'; |
| 15 | |
| 16 | describe('landing Band B (Phase 2 easy start)', () => { |
| 17 | it('places Band B after the GitHub badge and before deploy headlines', () => { |
| 18 | const badge = indexHtml.indexOf('class="badge-wrap"'); |
| 19 | const bandB = indexHtml.indexOf('class="band-b-path wide"'); |
| 20 | const deploy = indexHtml.indexOf('class="deploy-headlines wide"'); |
| 21 | assert.ok(badge !== -1 && bandB !== -1 && deploy !== -1); |
| 22 | assert.ok(badge < bandB && bandB < deploy); |
| 23 | }); |
| 24 | |
| 25 | it('includes hero-equivalent Hub and self-host quick start links inside Band B', () => { |
| 26 | const bandB = indexHtml.indexOf('class="band-b-path wide"'); |
| 27 | const deploy = indexHtml.indexOf('class="deploy-headlines wide"'); |
| 28 | const slice = indexHtml.slice(bandB, deploy); |
| 29 | const hubInBand = slice.indexOf(hubPath); |
| 30 | const selfHostInBand = slice.indexOf(selfHostAnchor); |
| 31 | const aiSetupInBand = slice.indexOf(aiAssistedSetup); |
| 32 | assert.ok(hubInBand !== -1, 'Hosted Hub link missing in Band B'); |
| 33 | assert.ok(selfHostInBand !== -1, 'Self-host quick start link missing in Band B'); |
| 34 | assert.ok(aiSetupInBand !== -1, 'AI-assisted setup link missing in Band B'); |
| 35 | assert.ok( |
| 36 | hubInBand < selfHostInBand, |
| 37 | 'Hosted Hub should appear before self-host quick start in Band B' |
| 38 | ); |
| 39 | }); |
| 40 | |
| 41 | it('exposes section landmark, number beside title, and three step titles', () => { |
| 42 | assert.match( |
| 43 | indexHtml, |
| 44 | /class="band-b-path wide" aria-label="Three steps: note or import, add agents, ask your AI"/ |
| 45 | ); |
| 46 | assert.match(indexHtml, /class="band-b-step-head"/); |
| 47 | assert.match(indexHtml, /class="band-b-step-title">Note \/ import</); |
| 48 | assert.match(indexHtml, /class="band-b-step-title">Add agents</); |
| 49 | assert.match(indexHtml, /class="band-b-step-title">Ask your AI</); |
| 50 | assert.match(indexHtml, /\.band-b-step-marker\s*\{[^}]*font-size:\s*clamp\(/s); |
| 51 | }); |
| 52 | |
| 53 | it('meta description mentions proposals and human approval', () => { |
| 54 | assert.match( |
| 55 | indexHtml, |
| 56 | /<meta name="description" content="[^"]*proposals need human approval[^"]*">/ |
| 57 | ); |
| 58 | }); |
| 59 | }); |
File History
2 commits
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd
feat(calendar): enforce agent context tiers in retrieval AP…
Human
minor
⚠
1 day ago
sha256:9103f98c89257ed2b01c237cea895dabb3e85ea337dccb1161c175e4422355b6
docs: accept Calendar Events v0 spec with Phase 0 security …
Human
1 day ago