How it works page /how (Marty 2026-11-15: "a How It Works section with maybe a diagram"): three accessible inline SVG diagrams in the daylight look (your ad spreading five levels down with YOUR ad in the matching LEVEL row; what a member page shows; where a $5 Boost goes with the pass-up skip over a non-buyer and the 50% company share), What counts as a view cards, 500-view delivery (ticker star, Boosted places, Network Ad Space after 30 days), Start in 3 steps with CTAs, FAQ with FAQPage schema. Linked from the nav, the footer and the front page ("How a Boost works", "See how it works"); /how reserved from usernames, in the sitemap; css v6, common v7. Smoke 194/194 (new: /how content, links, sitemap, desktop + phone render, no dashes, no console errors).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-15 06:54:37 -06:00
parent 72f4eb664f
commit 3920e53db2
18 changed files with 439 additions and 50 deletions
+14 -2
View File
@@ -195,9 +195,14 @@ async function main() {
console.log('3. pages');
const anon = client();
for (const p of ['/', '/my', '/boost', '/ledger', '/contract', '/promote', '/terms', '/disclaimer', '/privacy', '/admin', '/robots.txt', '/sitemap.xml', '/art/mark.svg', '/art/og-share.png', '/assets/vab.css', '/assets/common.js']) { const r = await anon.req(p); ok(r.status === 200, 'GET ' + p + ' 200', r.status); }
for (const p of ['/', '/how', '/my', '/boost', '/ledger', '/contract', '/promote', '/terms', '/disclaimer', '/privacy', '/admin', '/robots.txt', '/sitemap.xml', '/art/mark.svg', '/art/og-share.png', '/assets/vab.css', '/assets/common.js']) { const r = await anon.req(p); ok(r.status === 200, 'GET ' + p + ' 200', r.status); }
let r = await anon.req('/'); const home = await r.text();
ok(/<h1 class="slant"><span class="l1">Spread your ad<\/span> <span class="l2">5 levels deep<\/span><\/h1>/.test(home) && /id="boardCards"/.test(home) && /og:image" content="https:\/\/viraladblitz\.com\/art\/og-share\.png/.test(home), 'front page: "Spread your ad 5 levels deep" headline, board, Open Graph');
r = await anon.req('/how'); const how = await r.text();
ok((how.match(/<svg viewBox="[^"]+" role="img" aria-labelledby="[^"]+"/g) || []).length === 3 && /Your ad spreads down your team/.test(how) && /What counts as a view/.test(how) && /Boost: where your \$5 goes/.test(how) && /Start in 3 steps/.test(how)
&& (how.match(/<details>/g) || []).length >= 5 && /PASSED OVER/.test(how) && /A Boost buys advertising, not income\. Nothing is promised\./.test(how) && /SafePal or any other crypto wallet/.test(how) && !/[—–]/.test(how) && /"@type":"FAQPage"/.test(how), 'How it works page: 3 accessible diagrams, 4 sections, FAQ, pass-up shown, copy rules', how.length);
ok(/href="\/how#boost">How a Boost works</.test(home) && /href="\/how"/.test(home) && /'\/how', 'How it works'/.test(fs.readFileSync(path.join(APP, 'public/assets/common.js'), 'utf8')) && /<a href="\/how">How it works<\/a>/.test(fs.readFileSync(path.join(APP, 'public/assets/common.js'), 'utf8')), 'How it works linked from the nav, the footer and the front page ("How a Boost works")');
ok((await (await anon.req('/sitemap.xml')).text()).includes('/how</loc>'), 'sitemap lists /how');
ok(!r.headers.get('x-frame-options'), 'front page stays frameable (traffic exchanges)');
r = await anon.req('/my'); ok(r.headers.get('x-frame-options') === 'DENY', '/my is never framed');
ok(/script-src[^;]*https:\/\/linkspin\.app/.test(r.headers.get('content-security-policy') || ''), 'CSP admits linkspin.app (network zones)');
@@ -460,13 +465,20 @@ const mtop = await anon.json('/api/wire?page=member&u=topdog');
// nothing leaves this machine; UI_FONTS=1 lets Google Fonts through so the screenshots show the real type (read-only font GETs)
await ctx.route(/^https:\/\//, rt => (process.env.UI_FONTS && /^https:\/\/fonts\.(googleapis|gstatic)\.com\//.test(rt.request().url())) ? rt.continue() : rt.abort());
const errs = []; const pg = await ctx.newPage(); pg.on('pageerror', e => errs.push(e.message));
for (const [p, sel] of [['/', '#boardCards .paper'], ['/owner', '#levels .lvl'], ['/boost', '#bQty option'], ['/ledger', '#rows tbody tr'], ['/contract', '#facts th'], ['/promote', '#kit .card'], ['/terms', '.legal .card'], ['/disclaimer', '.legal .card'], ['/privacy', '.legal .card']]) {
for (const [p, sel] of [['/', '#boardCards .paper'], ['/how', '.dg svg[role=img]'], ['/owner', '#levels .lvl'], ['/boost', '#bQty option'], ['/ledger', '#rows tbody tr'], ['/contract', '#facts th'], ['/promote', '#kit .card'], ['/terms', '.legal .card'], ['/disclaimer', '.legal .card'], ['/privacy', '.legal .card']]) {
await pg.goto(BASE + p, { waitUntil: 'domcontentloaded' }); await pg.waitForSelector(sel, { timeout: 8000 }).catch(() => {});
const found = await pg.$$eval(sel, els => els.length);
const wide = await pg.evaluate(() => document.documentElement.scrollWidth - window.innerWidth);
ok(found > 0 && wide <= 1, label + ' ' + p + ': renders (' + sel + ') with no sideways scroll', { found, wide });
await pg.screenshot({ path: path.join(OUT, label + '-' + (p === '/' ? 'front' : p.slice(1)) + '.png'), fullPage: true });
}
{ const cerr = [], bad = []; const onC = m => { if (m.type() === 'error' && !/Failed to load resource|net::ERR_FAILED/.test(m.text())) cerr.push(m.text()); }; const onR = rs => { if (rs.url().startsWith(BASE) && rs.status() >= 400) bad.push(rs.status() + ' ' + rs.url()); };
pg.on('console', onC); pg.on('response', onR);
await pg.goto(BASE + '/how', { waitUntil: 'load' }); await pg.waitForSelector('#ticker .run a', { timeout: 8000 }).catch(() => {});
const hv = await pg.evaluate(() => ({ svgs: [...document.querySelectorAll('.dg svg')].map(s => Math.round(s.getBoundingClientRect().width)), dash: /[—–]/.test(document.body.innerText), nav: !!document.querySelector('nav.top a.on[href="/how"]'), foot: !!document.querySelector('footer a[href="/how"]'), wide: document.documentElement.scrollWidth - window.innerWidth }));
await pg.click('.faq details summary'); const opened = await pg.$eval('.faq details', d => d.open);
ok(hv.svgs.length === 3 && hv.svgs.every(w => w >= 280) && !hv.dash && hv.nav && hv.foot && hv.wide <= 1 && opened && !cerr.length && !bad.length, label + ' /how: 3 diagrams at readable width, no dashes, nav on, footer link, FAQ opens, no console errors, no failed same-origin requests', { hv, opened, cerr, bad });
pg.off('console', onC); pg.off('response', onR); }
await pg.goto(BASE + '/', { waitUntil: 'domcontentloaded' }); await pg.waitForSelector('#ticker .run a', { timeout: 8000 }).catch(() => {});
ok((await pg.$$eval('#ticker .run a', els => els.length)) > 0 && (await pg.textContent('footer')).includes('TrustClickz') && /Part of the network/.test(await pg.textContent('footer')), label + ': ticker runs; footer has the company line and the network line');
await pg.goto(BASE + '/owner', { waitUntil: 'domcontentloaded' }); await pg.waitForSelector('#levels .lvl a[data-go]', { timeout: 8000 }).catch(() => {});