From c2a2ef778cf728ff29b953b9842b2a39b1e9cbea Mon Sep 17 00:00:00 2001 From: sganggs Date: Wed, 7 Oct 2026 20:04:10 +0800 Subject: [PATCH] =?UTF-8?q?feedback6:=20the=20=E8=81=94=E9=98=B2=20down-ri?= =?UTF-8?q?ng=20render=20test=20reads=20=E5=BE=B7=E5=85=8B=E8=90=A8?= =?UTF-8?q?=E6=96=AF's=20redeploy=20time=20and=20cost=20from=20the=20data?= =?UTF-8?q?=20=E2=80=94=20at=20full=20potential=2060=20s=20and=2011=20(it?= =?UTF-8?q?=20hard-coded=2070=20s=20/=2013;=20an=20opt-in=20RENDER=5FE2E?= =?UTF-8?q?=20suite,=20so=20the=20R21P=20stream's=20broad=20run=20did=20no?= =?UTF-8?q?t=20reach=20it)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - RENDER_E2E=1 unitedown.browser 1 / 1 (failed in the 0.2.1 full pass: 54 s left at 6 s). --- test/render/unitedown.browser.test.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/render/unitedown.browser.test.js b/test/render/unitedown.browser.test.js index ef2e47c4..0ee7de4e 100644 --- a/test/render/unitedown.browser.test.js +++ b/test/render/unitedown.browser.test.js @@ -10,7 +10,7 @@ import { test, describe, before, after } from 'node:test'; import assert from 'node:assert/strict'; -import { existsSync, mkdirSync } from 'node:fs'; +import { existsSync, mkdirSync, readFileSync } from 'node:fs'; import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { buildBattleSpec } from '../../server/sim/spec.js'; @@ -21,6 +21,8 @@ const OUT = path.join(ROOT, 'test/e2e/out'); const CHROME = process.env.CHROME_PATH || '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'; const enabled = process.env.RENDER_E2E === '1' && existsSync(CHROME) && existsSync(path.join(ROOT, 'public/assets')); const skip = enabled ? false : 'set RENDER_E2E=1 (needs Chrome and downloaded assets)'; +// 德克萨斯's redeploy time and cost from the data (at full potential since 0.2.1: 60 s and 11; 70 s and 13 before) +const TEXAS = JSON.parse(readFileSync(path.join(ROOT, 'data/chess.json'), 'utf8')).chess_char_1_08_a.stats; // the right-hand helper of a two-helper 联防 (colOffset +8): 德克萨斯 knocked out in its own combat, // with 艾雅法拉 standing at half HP; the only enemy spawns long after the check (it keeps the battle running) @@ -115,12 +117,13 @@ describe('联防: an operator knocked out in its own combat enters down (headles assert.equal(st[texas].down, 0, 'down, its timer counting'); assert.ok(st[texas].ring, 'redeploy ring'); const gt = await page.evaluate(() => window.__sim.battle.time); - assert.ok(gt > 5.9 && ['64', '65', '66'].includes(st[texas].label), `its full 70 s timer (${st[texas].label} s left at ${gt.toFixed(2)} s)`); + const left = [6, 5, 4].map((k) => String(TEXAS.respawnTime - k)); + assert.ok(gt > 5.9 && left.includes(st[texas].label), `its full ${TEXAS.respawnTime} s timer (${st[texas].label} s left at ${gt.toFixed(2)} s)`); assert.equal(st[texas].dieClip, 'Die', 'held Die pose'); assert.ok(st[texas].alpha > 0.8, `drawn (alpha ${st[texas].alpha})`); assert.deepEqual([Math.round(st[texas].x), Math.round(st[texas].y)], [12, 10], 'on its own tile (board col 4 + 8)'); assert.equal(st[eyja].alive, true, 'the teammate stands'); - // fast-forward to the redeploy (DP 10 + 1/s ≥ cost 13 long before the 70 s timer ends) + // fast-forward to the redeploy (DP 10 + 1/s reaches her cost long before her redeploy timer ends) await run(40, 60); await run(30, 2); st = await page.evaluate(() => window.__sim.state());