Weekly prize pot (Marty 2026-11-13): 10% of the week's sales, $20 floor topped up by the company, $50 cap kept internal; half per leaderboard, split 50/30/20; leaderboard page shows the live pot, never the cap; smoke 100/100

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-13 15:42:03 -06:00
parent 832395daa4
commit cb77582926
6 changed files with 22 additions and 9 deletions
+3 -2
View File
@@ -102,7 +102,8 @@ async function main() {
ok(cfg.loopSize === 5 && cfg.perShift === 3 && cfg.viewsPerCycle === 150 && cfg.visitSeconds === 2, 'config from env', cfg);
ok(fs.readFileSync(path.join(OUT, 'server.log'), 'utf8').includes('files (prototype mode)'), 'server says prototype mode (no DOCSTORE_URL)');
ok(JSON.stringify(cfg.packs) === '[{"credits":10,"usd":3},{"credits":40,"usd":10}]' && cfg.lookUsd === 2 && cfg.freeCreditsPerDay === 1, 'approved defaults: packs 10 for $3 + 40 for $10, look $2, 1 free credit a day', cfg);
ok(JSON.stringify(cfg.prizes) === '{"visitors":[15,7,3],"sources":[15,7,3]}', 'approved weekly prizes: $15/$7/$3 per leaderboard', cfg.prizes);
ok(cfg.prizes && cfg.prizes.pot === 20 && JSON.stringify(cfg.prizes.visitors) === '[5,3,2]' && JSON.stringify(cfg.prizes.sources) === '[5,3,2]', 'prize pot: $20 floor with no sales, $5/$3/$2 per board', cfg.prizes);
ok(!JSON.stringify(cfg).includes('capUsd') && !JSON.stringify(cfg).includes('"cap'), 'public config never shows the prize cap', cfg);
console.log('3. splash');
const anon = client();
@@ -261,7 +262,7 @@ async function main() {
await pg.goto(BASE + '/leaders', { waitUntil: 'domcontentloaded' }); await pg.waitForSelector('#lbVisitors table', { timeout: 8000 });
ok((await pg.textContent('#lbVisitors')).includes('@smokeleader'), name + ': leaderboard page shows the leader');
await pg.screenshot({ path: path.join(OUT, 'leaders-' + name + '.png'), fullPage: true });
ok(/1st: \$15 in POL/.test(await pg.textContent('#pz')), name + ': leaderboard page shows the weekly prizes');
ok(/1st: \$5 in POL/.test(await pg.textContent('#pz')) && /at least \$20, and it grows with sales/.test(await pg.textContent('#prizes')) && !/50/.test(await pg.textContent('#prizes')), name + ': leaderboard page shows the pot, never the cap');
await pg.goto(BASE + '/packages', { waitUntil: 'domcontentloaded' }); await pg.waitForTimeout(400);
const pk = await pg.textContent('#pk');
ok(/10 post credits for \$3/.test(pk) && /40 post credits for \$10/.test(pk) && /\$2 per banner/.test(pk) && /Coming soon/i.test(pk), name + ': packages page shows the planned prices as coming soon', pk.slice(0, 200));