Promo kit (Marty 2026-11-14: "get all the creatives built for downline banners and VBB, and put them in all the places they need to go"): promokit.js is the one source for the Downline Banners kit, published as GET /api/promo-kit?u=<network username or wallet> (public, CORS open, read by /promote and by InstantAdPay's Promo tools > Network sites): personal links (?ref=), 21 creatives (3 angles: $5 spot + 300 guaranteed views / 10 levels pay as spots sell after yours / no withdrawals, paid in the same transaction; each in 125x125, 468x60, 728x90, 300x250, 160x600, 1200x630, 1080x1080) at /art/kit/dlb-<angle>-<shape>.png (ad-blocker-neutral names, rendered crisp from HTML by tools/kit-art.mjs with Playwright), 5 lines, 3 headlines, 1 email, 2 posts (facts per SPEC.md + contract: sponsor 30%, 10 levels x 5.5%, splits fixed; nothing promised). /promote page (kitpage.js + promote.js + kit.css): username from sign-in, ?u= or typed; nav + footer link Promote; sitemap. server.js: one require + one hook line. common.js?v=20261114p. Smoke 106/106 (promo kit feed, every PNG at its exact size, Promote page signed in, desktop + phone screenshots; gate step now screenshots itself if it ever stalls).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+31
-2
@@ -126,6 +126,30 @@ async function main() {
|
||||
const qq = await u.json('/api/quote'); ok(qq.wei === q.toString() && qq.source === 'contract.quoteWei', '/api/quote reads quoteWei()', qq);
|
||||
for (const p of ['/', '/board', '/join', '/my', '/how', '/assets/site.css', '/art/house-line.svg']) { const r = await u.req(p); ok(r.status === 200, 'GET ' + p + ' 200'); }
|
||||
const r404 = await u.req('/nope'); ok(r404.status === 404, 'unknown path 404');
|
||||
// promo kit (2026-11-14): one public feed read by /promote and by InstantAdPay's promo center
|
||||
{
|
||||
const kr = await u.req('/api/promo-kit?u=alpha'); const k = await kr.json();
|
||||
ok(kr.status === 200 && kr.headers.get('access-control-allow-origin') === '*', 'promo kit: GET /api/promo-kit 200 with CORS open', kr.status);
|
||||
ok(k.username === 'alpha' && k.links.length === 3 && k.links.every(l => l.url.startsWith('https://downlinebanners.com/') && l.url.endsWith('?ref=alpha')), 'promo kit: every link carries ?ref=<username>', k.links);
|
||||
ok(k.lines.length === 5 && k.headlines.length === 3 && k.posts.length === 2 && k.email && k.email.body.includes('?ref=alpha'), 'promo kit: 5 lines, 3 headlines, 1 email, 2 posts, link filled in');
|
||||
const words = JSON.stringify([k.lines, k.headlines, k.email, k.posts, k.note, k.tagline]);
|
||||
ok(!/[—–]/.test(words) && !/passive income|guaranteed (income|returns|profit|earnings)|earn (cash|money)|make money/i.test(words) && /300 guaranteed views/.test(words) && /30%/.test(words) && /5\.5%/.test(words), 'promo kit copy: no dashes, no income promises, facts match the contract (300 views, 30%, 5.5%)');
|
||||
ok(k.creatives.length === 21 && new Set(k.creatives.map(c => c.angle)).size === 3, 'promo kit: 21 creatives in 3 angles', k.creatives.length);
|
||||
const badName = k.creatives.filter(c => /\d{2,4}x\d{2,4}|banner|[-_/]ads?[-_./]/i.test(c.url.replace('https://downlinebanners.com', '')));
|
||||
ok(badName.length === 0, 'promo kit: creative paths are ad-blocker neutral', badName.map(c => c.url));
|
||||
const bad = [];
|
||||
for (const c of k.creatives) {
|
||||
const rr = await u.req(new URL(c.url).pathname); const buf = Buffer.from(await rr.arrayBuffer());
|
||||
if (rr.status !== 200 || rr.headers.get('content-type') !== 'image/png' || buf.readUInt32BE(16) !== c.w || buf.readUInt32BE(20) !== c.h) bad.push(c.key + ' ' + rr.status);
|
||||
if (!c.html.includes('href="https://downlinebanners.com/?ref=alpha"')) bad.push(c.key + ' html');
|
||||
}
|
||||
ok(bad.length === 0, 'promo kit: every creative served as PNG at its exact size, HTML links to the member', bad);
|
||||
ok((await u.req('/art/kit/../server.js')).status !== 200 && (await u.req('/art/kit/nope.png')).status === 404, 'promo kit: /art/kit serves kit files only');
|
||||
const k2 = await (await u.req('/api/promo-kit?u=' + encodeURIComponent('<b>'))).json();
|
||||
ok(k2.username === null && k2.links[0].url === 'https://downlinebanners.com/', 'promo kit: a bad username is ignored', k2.links[0]);
|
||||
const pr = await u.req('/promote'); const ph = await pr.text(); ok(pr.status === 200 && /id="kit"/.test(ph), 'GET /promote serves the Promote page');
|
||||
ok((await (await u.req('/sitemap.xml')).text()).includes('/promote'), 'sitemap lists /promote');
|
||||
}
|
||||
const myHdr = await u.req('/my'); ok(myHdr.headers.get('x-frame-options') === 'DENY' && !(await u.req('/')).headers.get('x-frame-options'), '/my not frameable, / frameable');
|
||||
|
||||
// ---- 3. gate (HTTP) ----
|
||||
@@ -246,12 +270,16 @@ async function main() {
|
||||
const watch = (pg, name) => { pg.on('console', msg => { if (msg.type() === 'error') errors.push(name + ': ' + msg.text() + ' @ ' + ((msg.location() || {}).url || '')); }); pg.on('pageerror', e => errors.push(name + ': ' + e.message)); };
|
||||
// member context: signed in, gate skipped
|
||||
const ctxM = await browser.newContext(); await ctxM.addCookies([{ name: 'bl.sid', value: m.jar['bl.sid'], url: BASE }]);
|
||||
for (const p of ['/', '/board', '/how', '/join', '/my']) {
|
||||
for (const p of ['/', '/board', '/how', '/join', '/my', '/promote']) {
|
||||
const pg = await ctxM.newPage(); watch(pg, 'member ' + p);
|
||||
await pg.goto(BASE + p, { waitUntil: 'networkidle' });
|
||||
await pg.screenshot({ path: path.join(OUT, 'member' + (p === '/' ? '-home' : p.replace('/', '-')) + '.png'), fullPage: true });
|
||||
const foot = await pg.textContent('footer').catch(() => ''); ok(/Part of the Crypto Team Build Network/.test(foot || ''), 'member ' + p + ' renders with footer');
|
||||
if (p === '/my') { await pg.waitForSelector('#dash:not([hidden])', { timeout: 8000 }).catch(() => {}); ok(await pg.isVisible('#dash'), '/my dashboard visible'); ok((await pg.$$('.spot-ed')).length >= 3, '/my spot editors listed'); }
|
||||
if (p === '/promote') { await pg.waitForSelector('#kit .kit-fig img', { timeout: 8000 }).catch(() => {}); const kt = await pg.textContent('#kit'); const who = await pg.inputValue('#whoIn');
|
||||
ok(!!who && kt.includes('?ref=' + who) && (await pg.$$('#kit .kit-set:not([hidden]) .kit-fig')).length === 7, '/promote shows the kit with the signed-in member link (' + who + ')'); ok(!!(await pg.$('nav a[href="/promote"]')), 'nav links to Promote');
|
||||
await pg.waitForTimeout(500); await pg.screenshot({ path: path.join(OUT, 'member-promote.png'), fullPage: true });
|
||||
await pg.setViewportSize({ width: 390, height: 844 }); await pg.waitForTimeout(300); await pg.screenshot({ path: path.join(OUT, 'member-promote-phone.png'), fullPage: true }); }
|
||||
if (p === '/join') { await pg.waitForSelector('#buyCard:not([hidden])', { timeout: 8000 }).catch(() => {}); const price = await pg.textContent('#price'); ok(/^0\.0025/.test(price), '/join shows price ' + price); }
|
||||
const em = await pg.evaluate(() => document.body.innerText.includes('\u2014')); ok(!em, p + ' has no em dash');
|
||||
await pg.close();
|
||||
@@ -261,7 +289,8 @@ async function main() {
|
||||
await pg.goto(BASE + '/?ref=' + addr[B], { waitUntil: 'domcontentloaded' });
|
||||
await pg.waitForSelector('#gate:not([hidden])');
|
||||
for (let i = 0; i < 8; i++) {
|
||||
await pg.waitForSelector('#gNext:not([hidden])', { timeout: 20000 });
|
||||
try { await pg.waitForSelector('#gNext:not([hidden])', { timeout: 20000 }); }
|
||||
catch (e) { await pg.screenshot({ path: path.join(OUT, 'visitor-gate-stuck.png'), fullPage: true }).catch(() => {}); console.log(' gate stuck at step', i, JSON.stringify(await pg.evaluate(() => ({ what: (document.getElementById('gWhat') || {}).textContent, status: (document.getElementById('status') || {}).textContent })).catch(() => null))); throw e; }
|
||||
const label = await pg.textContent('#gNext'); await pg.click('#gNext');
|
||||
if (label === 'Continue') break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user