mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 17:37:50 -05:00
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 <[email protected]>
This commit is contained in:
1 parent
ceda20ffc8
commit
57abc8746d
3 files changed
+12
-7
No files matched your search
+4
-1
@@ -413,7 +413,10 @@ const run = async () => {
|
|||||||
assert.deepStrictEqual([sent[2], sent[7], sent[8], sent[9]], ["2", "0", "1", hat]);
|
assert.deepStrictEqual([sent[2], sent[7], sent[8], sent[9]], ["2", "0", "1", hat]);
|
||||||
assert.deepStrictEqual((await a.nextXt("es")).slice(2), ["1"]);
|
assert.deepStrictEqual((await a.nextXt("es")).slice(2), ["1"]);
|
||||||
const pushed = await b.untilXt("ep");
|
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);
|
b.xt("el", own[4], 0);
|
||||||
const inbox = await b.nextXt("el");
|
const inbox = await b.nextXt("el");
|
||||||
assert.deepStrictEqual([inbox[2], inbox.length], ["1", 3 + 17]);
|
assert.deepStrictEqual([inbox[2], inbox.length], ["1", 3 + 17]);
|
||||||
|
|||||||
+4
-3
@@ -100,9 +100,10 @@ class GameClient {
|
|||||||
this.varUpdates.push(fields);
|
this.varUpdates.push(fields);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// the chat filter settings ("xfl", after every login) and the one-time
|
// the chat filter settings ("xfl", after every login), the one-time
|
||||||
// question which filter to use ("xfa", on the first room) come unasked.
|
// question which filter to use ("xfa", on the first room) and the
|
||||||
if ((fields[0] === "xfl" || fields[0] === "xfa") && cmd !== fields[0]) {
|
// 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;
|
continue;
|
||||||
}
|
}
|
||||||
if (this.unasked(fields)) {
|
if (this.unasked(fields)) {
|
||||||
|
|||||||
+4
-3
@@ -383,12 +383,13 @@ const run = async () => {
|
|||||||
const moved = await c.nextXt("rp");
|
const moved = await c.nextXt("rp");
|
||||||
assert.deepStrictEqual([moved[4], moved[5]], ["2", newDenDef]); // room type 2 = den, then the den type
|
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 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);
|
a.xt("dc", denId, 0);
|
||||||
await a.nextXt("dc");
|
await a.nextXt("dc");
|
||||||
await c.nextXt("rp");
|
await c.nextXt("rp");
|
||||||
assert.deepStrictEqual((await c.nextXt("ds")).slice(2, 3), ["1"]);
|
assert.deepStrictEqual((await c.nextXt("ds")).slice(2, 3), ["1"]);
|
||||||
await a.nextXt("ds");
|
await a.untilXt("ds");
|
||||||
a.xt("dp", denId, 0, 0);
|
a.xt("dp", denId, 0, 0);
|
||||||
{
|
{
|
||||||
const stranger = new GameClient();
|
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]);
|
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
|
// --- 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();
|
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)));
|
assert.ok(found.total > 0 && found.results.every(item => /top/i.test(item.name) && /hat/i.test(item.name)));
|
||||||
const hat = found.results[0];
|
const hat = found.results[0];
|
||||||
|
|||||||
Reference in new issue
Block a user