Merge pull request #1188 from bbassie/fix/research-queue-message

Print only what changed in the research queue chat line
This commit is contained in:
Bastiaan authored and GitHub committed 2026-11-07 14:51:42 +00:00
1 parent 7cf9cf8d3e
commit bd9c4a5fea
7 files changed
+209 -28

No files matched your search

+7 -2
View File
@@ -5,8 +5,8 @@ import * as mock from "../../../test/mock.js";
import loadInstancePlugin from "../dist/node/instance.js";
import { plugin as info } from "../dist/node/index.js";
import {
ContributionEvent, FinishedEvent, QueueEvent, QueueSyncRequest, QueueUpdateEvent, SyncTechnologiesRequest,
TechnologySync,
ContributionEvent, FinishedEvent, QueueChange, QueueEvent, QueueSyncRequest, QueueUpdateEvent,
SyncTechnologiesRequest, TechnologySync,
} from "../dist/node/messages.js";
describe("research_sync instance", function() {
@@ -75,6 +75,11 @@ describe("research_sync instance", function() {
await handler()(new QueueEvent(["a"], "Bob", "rs-2"));
assert.equal(lastCommand(), applyCommand({ queue: ["a"], instance: "rs-2", player: "Bob" }));
});
it("should pass on the changes", async function() {
const changes = [new QueueChange("added", "a", 0, 1)];
await handler()(new QueueEvent(["a"], "Bob", "rs-2", changes));
assert.equal(lastCommand(), applyCommand({ queue: ["a"], instance: "rs-2", player: "Bob", changes }));
});
it("should leave out a null player", async function() {
await handler()(new QueueEvent(["a"], null, "rs-2"));
assert.equal(lastCommand(), applyCommand({ queue: ["a"], instance: "rs-2" }));