Two-plane load fix + e2e coverage for 2-plane gameplay (ISS-055, v0.31.0) #62

Merged
kamilkrzywda merged 4 commits from fix/two-planes-load-and-e2e into master 2026-09-21 01:08:55 +02:00
Showing only changes of commit 04b6f20a93 - Show all commits
+10 -1
View File
@@ -226,7 +226,13 @@ async function healPlaneHome(page: Page, planeId: string): Promise<void> {
if (p.locationIcao !== HUB) {
// ISS-057: the landing above slowed the sim to 1× — setScale restores 1000× for the return leg.
await setScale(page, SCALE);
expect((await page.request.post(`/api/planes/${planeId}/fly`, { data: { destIcao: HUB } })).status()).toBe(200);
let flyHome = await page.request.post(`/api/planes/${planeId}/fly`, { data: { destIcao: HUB } });
if (flyHome.status() === 409) {
// A long outbound leg can leave the tank too empty for the return — top up and retry.
expect((await page.request.post(`/api/planes/${planeId}/refuel`)).status()).toBe(200);
flyHome = await page.request.post(`/api/planes/${planeId}/fly`, { data: { destIcao: HUB } });
}
expect(flyHome.status()).toBe(200);
await expect
.poll(async () => ((await getState(page)).planes.find((x) => x.id === planeId)?.locationIcao ?? ''), {
timeout: 240_000,
@@ -374,6 +380,9 @@ test('two planes fly in parallel; the last landing slows to 1× and the next dis
expect(landed.packages.find((p) => p.id === pkgA.id)?.status).toBe('delivered');
expect(landed.packages.find((p) => p.id === pkgB.id)?.status).toBe('delivered');
// The outbound to the range edge left the tank nearly empty — top up for the return leg.
expect((await page.request.post(`/api/planes/${secondId}/refuel`)).status()).toBe(200);
// Resume semantics: with the starter still grounded, dispatching the second plane does NOT resume…
const flyB2 = await page.request.post(`/api/planes/${secondId}/fly`, { data: { destIcao: HUB } });
expect(flyB2.status()).toBe(200);