Game Pass (IAP side): $5 weekly pass across all nine games + account-wide POL cap service
- gamepass.js: durable pass store, waiting orders fulfilled by the next $5 package, cap ledger (daily/total per Central day, progress deferral + next-day carry-forward, idempotent refs kept 90 days, void), weekly Pass Tournament (Monday 9 AM Central, marks.claim, prizes recorded for the game faucets), admin stats. Settings in site config, caps enforced only from capsStartDate (recorded before). - server.js: /api/partner/player, /api/partner/polgrant(+/void), /api/partner/tournament/pending|paid, /api/my/gamepass(+/buy), /api/admin/gamepass/stats|comp|tournament/run; gamePass claim on every sign-in hand-off token; purchase-event fulfilment inside the marks.claim block. - Members > Games: Game Pass card (Buy via IAP.confirmBox, deep link /my#games?pass=1), Overview nudge after a free-cap hit. Admin > Game Pass pane. Chatbot canned answer + FACTS, KNOWLEDGE_DATE 10-16. - qa/gamepass.mjs scripted test (bash qa/run.sh gamepass), Games tab card in qa/walk.mjs. - docs/GAME-PASS.md: 3a clarifications + Built section; docs/GAME-PASS-RELEASE.md draft (not sent). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+11
-1
@@ -115,6 +115,16 @@ if (MODE === 'member' || MODE === 'all') {
|
||||
await page.screenshot({ path: OUT + '/my-' + pn + '.png' }).catch(() => {});
|
||||
console.log('ok', label, 'subtabs:', subs.length);
|
||||
}
|
||||
// Game Pass card on the Games tab (2026-10-16): hidden while gamePassEnabled is off, rendered with its state and Buy button once on; /my#games?pass=1 highlights it
|
||||
await page.request.patch(LOCAL + '/api/admin/site', { headers: { Authorization: 'Bearer ' + (process.env.ADMIN_PASSWORD || 'localtest'), 'Content-Type': 'application/json' }, data: { gamePassEnabled: '1' } }).catch(() => {});
|
||||
await page.goto(LOCAL + '/my#games?pass=1', { waitUntil: 'networkidle' }); await page.waitForTimeout(1500); await hide(page);
|
||||
const gpVis = await page.evaluate(() => { const c = document.getElementById('gpCard'); return !!(c && !c.hidden && c.offsetHeight > 40 && /Game Pass/.test(c.textContent) && c.querySelector('#gpBuy, #gpGoBuy')); });
|
||||
if (!gpVis) note('bug', L + 'my#games/gamepass', 'Game Pass card did not render with gamePassEnabled on (deep link /my#games?pass=1)');
|
||||
else { await domChecks(page, L + 'my#games/gamepass'); console.log('ok Game Pass card'); }
|
||||
await page.request.patch(LOCAL + '/api/admin/site', { headers: { Authorization: 'Bearer ' + (process.env.ADMIN_PASSWORD || 'localtest'), 'Content-Type': 'application/json' }, data: { gamePassEnabled: '0' } }).catch(() => {});
|
||||
await page.goto(LOCAL + '/my#games'); await page.reload({ waitUntil: 'load' }); await page.waitForTimeout(2500); await hide(page); // a hash-only goto would not reload the card
|
||||
if (await page.evaluate(() => { const c = document.getElementById('gpCard'); return !!(c && !c.hidden); })) note('bug', L + 'my#games/gamepass', 'Game Pass card shows while gamePassEnabled is off');
|
||||
flush(bag, L + 'my#games/gamepass');
|
||||
await page.click('.bo-menu [data-pane="promo"]'); await page.waitForTimeout(800);
|
||||
if (!(await page.$$('#promoPosts .promo-block')).length) note('bug', L + 'promo', 'no post cards rendered');
|
||||
// viral links: the builder renders a ?ref= link; any page + ?ref=<member> redirects clean and sets the sponsor cookie; an unknown ref sets nothing
|
||||
@@ -144,7 +154,7 @@ if (MODE === 'member' || MODE === 'all') {
|
||||
// admin
|
||||
await page.goto(LOCAL + '/admin', { waitUntil: 'networkidle' });
|
||||
await page.fill('#adEmail', process.env.ADMIN_EMAIL || 'martybostick@gmail.com'); await page.click('#adSend'); await page.waitForSelector('#adVerify:not([hidden])'); await page.click('#adVerify'); await page.waitForTimeout(1200);
|
||||
for (const pn of ['overview', 'house', 'campaigns', 'members', 'reports', 'traffic', 'blog', 'releases', 'pnl', 'settings']) {
|
||||
for (const pn of ['overview', 'house', 'campaigns', 'members', 'reports', 'traffic', 'blog', 'releases', 'pnl', 'gamepass', 'settings']) {
|
||||
const label = L + 'admin#' + pn;
|
||||
await page.click('.bo-menu [data-pane="' + pn + '"]'); await page.waitForTimeout(1200);
|
||||
const vis = await page.evaluate(id => { const el = document.getElementById('pane-' + id); return el && !el.hidden && el.offsetHeight > 40; }, pn);
|
||||
|
||||
Reference in New Issue
Block a user