@bongos/core 1.19.93 → 1.19.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,67 +0,0 @@
1
- // tests/gate_launch_metadata.mjs — the landing gate is discoverable and degrades
2
- // without JavaScript (task 1002746).
3
- //
4
- // WHY THIS EXISTS. Until the front door moves to the landing page
5
- // (docs/design/front-door-and-hub-direction.md), public-landing/gate/index.html is
6
- // what answers cloudbongos.com/ — so it is what search results and link previews
7
- // describe, and what a JS-off visitor or a non-executing crawler receives. It
8
- // shipped with an internal-sounding <title>, no description, no social tags, and
9
- // no <noscript>, and the sky is entirely JS-built, so that visitor got a blank
10
- // page. The whole host is noindex pre-launch, which is exactly why the gap went
11
- // unnoticed — it costs nothing until the lock comes off, then it costs everything
12
- // at once.
13
- //
14
- // Pure disk read: no server boot, no DB, no network — this asserts the shipped
15
- // artifact, which is the thing that actually reaches a crawler.
16
-
17
- import assert from 'node:assert/strict';
18
- import { test } from 'node:test';
19
- import fs from 'node:fs';
20
- import path from 'node:path';
21
- import { fileURLToPath } from 'node:url';
22
-
23
- const REPO_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
24
- const GATE = path.join(REPO_ROOT, 'public-landing', 'gate', 'index.html');
25
- const html = fs.readFileSync(GATE, 'utf8');
26
-
27
- test('the gate carries a real product title, not an internal label', () => {
28
- const title = (html.match(/<title>([^<]*)<\/title>/) || [])[1] || '';
29
- assert.ok(title.trim().length > 0, 'the gate must have a <title>');
30
- // "Cloud Bongos — landing gate" described the file to us, not the product to a
31
- // stranger reading a search result.
32
- assert.doesNotMatch(title, /landing gate/i, `<title> must not read as an internal label: ${title}`);
33
- assert.match(title, /Cloud Bongos/);
34
- });
35
-
36
- test('the gate is describable by a crawler and a link preview', () => {
37
- assert.match(html, /<meta\s+name="description"\s+content="[^"]{40,}"/, 'needs a meta description');
38
- assert.match(html, /<link\s+rel="canonical"\s+href="https:\/\/cloudbongos\.com\/"/);
39
- for (const prop of ['og:type', 'og:site_name', 'og:url', 'og:title', 'og:description', 'og:image']) {
40
- assert.match(html, new RegExp(`property="${prop}"`), `missing ${prop}`);
41
- }
42
- for (const name of ['twitter:card', 'twitter:title', 'twitter:description', 'twitter:image']) {
43
- assert.match(html, new RegExp(`name="${name}"`), `missing ${name}`);
44
- }
45
- });
46
-
47
- test('the gate degrades to real content without JavaScript', () => {
48
- const block = (html.match(/<noscript>([\s\S]*?)<\/noscript>/) || [])[1];
49
- assert.ok(block, 'the JS-built sky must ship a <noscript> fallback');
50
- // It has to SAY something, not just exist — a stranger with JS off should learn
51
- // what this is and be able to leave through a real door.
52
- assert.match(block, /Cloud&nbsp;Bongos|Cloud Bongos/);
53
- assert.match(block, /href="\/projects"/, 'the fallback must reach the projects surface');
54
- assert.match(block, /href="\/create"/, 'the fallback must reach project creation');
55
- // Every rule in space.css is scoped to a body view-class the fallback must
56
- // ignore, so its visibility cannot depend on the stylesheet.
57
- assert.match(block, /style="/, 'the fallback must be inline-styled to survive the view-class CSS');
58
- });
59
-
60
- test('the gate still boots into a view class (the ritual removal has not landed yet)', () => {
61
- // Guards the file's structural contract while task 1002743 is outstanding: the
62
- // body carries a view class, and <head> closes before <body> opens. If the
63
- // ritual removal lands, the expected class becomes view-space — update this
64
- // assertion there rather than deleting it.
65
- assert.match(html, /<body class="view-(entry|space)"/);
66
- assert.ok(html.indexOf('</head>') < html.indexOf('<body class='), 'head must close before body opens');
67
- });