commit 40fca3b41cbb5804c433ac2a5396a35c83134095
parent ba311f2eec64b3ac29458d692e85b19a716de0f4
Author: anon <anon@example.com>
Date: Mon, 9 Nov 2026 09:53:18 +0000
Wait for browser actions and control corpse-refusal expiry
Wait for the native M-10 equip action before requesting removal, and wait for
world input readiness after Inventory Grid reload before opening its window.
Hold the corpse-refusal fixture's automatic expiry sweep until its explicit
retirement step so expired-item refusal and corpse cleanup are both tested.
Complete TestBrowserM10Qualities warm/cold, TestBrowserInventoryGrid and
TestBrowserCorpsePickupRefusal reruns pass. JavaScript syntax, gofmt and diff
checks pass. No production gameplay code changes.
Diffstat:
3 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/server/browser_loot_refusal_test.go b/server/browser_loot_refusal_test.go
@@ -94,9 +94,12 @@ func TestBrowserCorpsePickupRefusal(t *testing.T) {
world.clients[1].loading = false
}))
mux.HandleFunc("POST /test-deadline", testPlayerHTTP(world, 1, func(world *server, w http.ResponseWriter, r *http.Request) {
+ // Check deadline refusal before the explicitly controlled retirement step.
+ world.corpseExpiry = nil
world.characters[1000000].corpse.expiresAt = time.Now().Add(-time.Second)
}))
mux.HandleFunc("POST /test-expire", testPlayerHTTP(world, 1, func(world *server, w http.ResponseWriter, r *http.Request) {
+ world.corpseExpiry = []*character{world.characters[1000000]}
world.advanceCorpseExpiry(time.Now())
}))
mux.HandleFunc("POST /test-fill", testPlayerHTTP(world, 1, func(world *server, w http.ResponseWriter, r *http.Request) {
diff --git a/tools/client/test_inventory_grid.mjs b/tools/client/test_inventory_grid.mjs
@@ -74,6 +74,8 @@ try {
await page.reload();
await game.ready();
+ await page.waitForFunction(() => touchRegion(500, 400)?.world === true);
+ await game.snapshot();
if (!inventoryGrid(game.state)) await game.key('i');
await game.wait('inventory after reload', state => inventoryGrid(state));
for (let attempt = 0; attempt < 30; ++attempt) {
diff --git a/tools/client/test_m10.mjs b/tools/client/test_m10.mjs
@@ -45,6 +45,8 @@ try {
evidence['worn' + id] = {native: owner.local().inventory, server: await server()};
await owner.save(output + '/worn-' + id);
if (id !== 3) {
+ await owner.wait('native equipment action finishes', state =>
+ !owner.local(state).actions.includes(3) && !owner.local(state).actions.includes(6));
await owner.click(867, 206, 'right');
await owner.wait('same M-10 removed', state => owner.local(state).inventory.some(item => item.id === id && item.slot >= 48));
}