Remove one research queue entry per level a technology sync unlocks

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
ILLISISandClaude Opus 5.5 committed 2026-10-19 00:06:43 +11:00
1 parent ed1e4ee3cb
commit f7c78d9f74
2 files changed
+29 -6

No files matched your search

+17
View File
@@ -119,6 +119,23 @@ describe("research_sync controller", function() {
});
});
describe("technology sync unlocking several levels", function() {
const techSync = (name, level, researched) => mock.getHandler(controller, SyncTechnologiesRequest)(
new SyncTechnologiesRequest([new TechnologySync(name, level, null, researched)]), src
);
it("should drop one entry per level unlocked on a known technology", async function() {
await techSync("m", 4, true);
await update(["m", "m", "m", "x"]);
await techSync("m", 7, true);
assert.deepEqual(await sync(), ["x"]);
});
it("should drop one entry per level unlocked on a new technology", async function() {
await update(["m", "m", "x"]);
await techSync("m", 2, true);
assert.deepEqual(await sync(), ["x"]);
});
});
it("should persist the queue across loads", async function() {
await update(["a", "b"]);
await controller.hooks.save.invoke();