From 57abc8746d87c90df39e59e510b91bebd020618d Mon Sep 17 00:00:00 2001 From: Snipzil Date: Fri, 16 Oct 2026 22:50:47 -0400 Subject: [PATCH] test: catch up with the 17 October update - the buddy list and last-seen times ("bl", "xls") come unasked at login - the den owner is sent the den's items on a switch - a clothing gift goes by its picture's id; the shop page is the Item giver Co-Authored-By: Claude Opus 5.5 --- test/features.js | 5 ++++- test/harness.js | 7 ++++--- test/smoke.js | 7 ++++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/test/features.js b/test/features.js index 7675b12..96853ae 100644 --- a/test/features.js +++ b/test/features.js @@ -413,7 +413,10 @@ const run = async () => { assert.deepStrictEqual([sent[2], sent[7], sent[8], sent[9]], ["2", "0", "1", hat]); assert.deepStrictEqual((await a.nextXt("es")).slice(2), ["1"]); const pushed = await b.untilXt("ep"); - assert.deepStrictEqual(pushed.slice(3, 10), ["Ann", cards[9], stamps[9], "0", "A hat for you!", "1", shop[9]]); + // a clothing gift goes by the id of its picture (the def's layerDefId, + // lib/ecards.js giftId), not the item's + assert.deepStrictEqual(pushed.slice(3, 9), ["Ann", cards[9], stamps[9], "0", "A hat for you!", "1"]); + assert.ok(Number(pushed[9]) > 0); b.xt("el", own[4], 0); const inbox = await b.nextXt("el"); assert.deepStrictEqual([inbox[2], inbox.length], ["1", 3 + 17]); diff --git a/test/harness.js b/test/harness.js index 0a2082b..fbbbd7d 100644 --- a/test/harness.js +++ b/test/harness.js @@ -100,9 +100,10 @@ class GameClient { this.varUpdates.push(fields); continue; } - // the chat filter settings ("xfl", after every login) and the one-time - // question which filter to use ("xfa", on the first room) come unasked. - if ((fields[0] === "xfl" || fields[0] === "xfa") && cmd !== fields[0]) { + // the chat filter settings ("xfl", after every login), the one-time + // question which filter to use ("xfa", on the first room) and the + // buddy list with when each was last seen ("bl", "xls": at login) come unasked. + if ((fields[0] === "xfl" || fields[0] === "xfa" || fields[0] === "bl" || fields[0] === "xls") && cmd !== fields[0]) { continue; } if (this.unasked(fields)) { diff --git a/test/smoke.js b/test/smoke.js index f28d00b..1b29910 100644 --- a/test/smoke.js +++ b/test/smoke.js @@ -383,12 +383,13 @@ const run = async () => { const moved = await c.nextXt("rp"); assert.deepStrictEqual([moved[4], moved[5]], ["2", newDenDef]); // room type 2 = den, then the den type assert.deepStrictEqual((await c.nextXt("ds")).slice(2, 3), ["0"]); // the furniture stayed in the first den - assert.deepStrictEqual((await a.nextXt("ds")).slice(2, 3), ["0"]); + // the owner is also sent the den's items ("di") on a switch + assert.deepStrictEqual((await a.untilXt("ds")).slice(2, 3), ["0"]); a.xt("dc", denId, 0); await a.nextXt("dc"); await c.nextXt("rp"); assert.deepStrictEqual((await c.nextXt("ds")).slice(2, 3), ["1"]); - await a.nextXt("ds"); + await a.untilXt("ds"); a.xt("dp", denId, 0, 0); { const stranger = new GameClient(); @@ -411,7 +412,7 @@ const run = async () => { assert.deepStrictEqual([gone[2], gone[5], ...gone.slice(7)], ["2", "Alice", "0", "1", tradedInv]); // --- item finder: search by name and id, give to a connected player - assert.match(await (await fetch(`${BASE}/shop`)).text(), /Item finder/); + assert.match(await (await fetch(`${BASE}/shop`)).text(), /Item giver/); const found = await (await fetch(`${BASE}/api/search?q=top+hat&kind=clothing`)).json(); assert.ok(found.total > 0 && found.results.every(item => /top/i.test(item.name) && /hat/i.test(item.name))); const hat = found.results[0];