bend_puzzle/test/v4784-user-request-smoke-test.js
2026-08-01 16:06:14 +09:00

20 lines
3.4 KiB
JavaScript

'use strict';
const {assert,app,css,html,read,functionSource,buildMeta}=require('./helpers/app-source');
const catalog=JSON.parse(read('store-catalog.json')),server=read('server.js');
const retired=['glow','pulse','dash','starlight','neon','prism','comet'];
assert(retired.every(effect=>!catalog.some(item=>item.lineEffect===effect)&&!css.includes(`line-effect-${effect}`)),`A retired/light-emitting line effect remains: ${retired.find(effect=>catalog.some(item=>item.lineEffect===effect)||css.includes(`line-effect-${effect}`))}`);
const aurora=catalog.find(item=>item.id==='line-effect-aurora');
assert(aurora?.lineColor&&aurora.aurora===true&&!aurora.lineEffect&&catalog.filter(item=>item.lineEffect).length===0,'Aurora is not classified as a shop-only line color');
assert(app.includes('AURORA_COLOR_INTERVAL=2000')&&app.includes('AURORA_RGB_PALETTE=Object.freeze')&&functionSource('nextAuroraRgb').includes('auroraPaletteIndex')&&css.includes('transition:stroke 2s linear')&&css.includes('.gate-dot.line-effect-aurora'),'Aurora does not use the curated two-second line/gate palette');
assert(app.includes('MAX_RENDER_FPS=30')&&app.includes('AUXILIARY_FPS=30')&&app.includes('REACTION_TARGET_FPS=30')&&app.includes('DRAG_TARGET_FPS=30')&&functionSource('applyCamera').includes('GLOBAL_FRAME_INTERVAL'),'Not all manual visual pipelines are capped at 30 FPS');
assert(app.includes("location.pathname.endsWith('/debug-items')")&&server.includes("pathname.endsWith('/debug-items')")&&!html.includes('debugAllItemsToggle')&&!app.includes('デバッグ使用可'),'Debug access is not URL-only or still leaks into the item UI');
assert(functionSource('purchaseStoreItem').includes('paidCost:0')&&functionSource('purchaseStoreItem').includes('if(!debug&&data.score<price)'),'Debug URL does not retain the normal purchase flow with free debug settlement');
const seeded=functionSource('seededStoreItemIds');
assert(seeded.includes('cursorPool.slice(0,6)')&&seeded.includes('6-fixedTools.length')&&seeded.includes('return[...cursorPool.slice(0,6),...selectedOthers]'),'Store stock is not six cursors followed by six seeded non-cursor items');
const store=functionSource('renderStorePanel');
assert(store.includes("title:'カーソル'")&&store.includes("title:'その他のアイテム'")&&store.includes('.slice(0,6)')&&!app.includes('陳列は店ごとに異なります')&&!app.includes('便利な機能から6点を陳列しています。'),'Shop layout or removed copy is incorrect');
const inventoryCategory=functionSource('createInventoryCategoryView');
assert(inventoryCategory.includes("document.createElement('details')")&&inventoryCategory.includes("document.createElement('summary')")&&inventoryCategory.includes('inventoryCollapsedCategories'),'Inventory categories cannot be collapsed');
assert(!app.includes("title:'Line Colors'")&&!app.includes("title:'Line Effects'")&&!app.includes("title:'Emoji Effects'")&&!app.includes("title:'Tools'")&&!app.includes("title:'Cursors'")&&!html.includes('>SETTINGS<')&&!html.includes('>DEBUG<'),'Visible English category or panel labels remain');
assert(buildMeta.WORLD_GENERATION==='linkfield-single-world-20260801'&&app.includes('STARTER_SEED=0x9c37a5e1')&&functionSource('readWorld',server).includes('value.global?.worldGeneration!==BuildMeta.WORLD_GENERATION'),'Board generation was not fully reset with a new seed on client and server');
console.log('v47.87 user-requested Aurora, debug URL, FPS, shop, and inventory guards passed');