From f22717a7d51d8ef3f1be23a3ee5c2e8f4caa7447 Mon Sep 17 00:00:00 2001 From: Scott Anderson <662325+scottanderson@users.noreply.github.com> Date: Wed, 14 May 2025 22:57:20 -0400 Subject: [PATCH] tests/Warship.test.ts --- tests/Warship.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/Warship.test.ts b/tests/Warship.test.ts index ce5bd27a2..346e8eb58 100644 --- a/tests/Warship.test.ts +++ b/tests/Warship.test.ts @@ -90,8 +90,13 @@ describe("Warship", () => { // Warship need one more tick (for warship exec to actually build warship) game.executeNextTick(); expect(player1.units(UnitType.Warship)).toHaveLength(1); + expect(player1.units(UnitType.Port)).toHaveLength(1); - const dstPort = player1.buildUnit(UnitType.Port, game.ref(coastX, 10), {}); + const dstPort = player2.buildUnit( + UnitType.Port, + game.ref(coastX + 2, 10), + {}, + ); // Cannot buildExec with trade ship as it's not buildable (but // we can obviously directly add it to the player) @@ -116,7 +121,7 @@ describe("Warship", () => { constructionExecution(game, player1.id(), coastX + 1, 10, UnitType.Warship); expect(player1.units(UnitType.Warship)).toHaveLength(1); - const dstPort = player1.buildUnit(UnitType.Port, game.ref(coastX, 10), {}); + const [dstPort] = player1.units(UnitType.Port); player1.units(UnitType.Port)[0].delete(); // Cannot buildExec with trade ship as it's not buildable (but