Two-plane load fix + e2e coverage (ISS-055, v0.31.0)
CI / build + unit + e2e (pull_request) Failing after 8m13s

- LoadControls preselects the first eligible plane so Load is one-click with N planes
- LeftPane queue testids scoped by plane id (queue-leg/cancel/add[-dest]-{plane.id})
  — unscoped ids duplicated in the DOM with two on-board blocks
- new POST /api/test/add-cash hook (FLIGHT_TEST_HOOKS=1, default €1M) so e2e can
  afford a second plane; returns the full state snapshot
- new serial spec e2e/two-planes.spec.ts: load, parallel fly + ISS-057 slow/resume,
  refuel, relocate, per-plane queues with auto-chain, sell (6 tests)
- e2e/queue.spec.ts locators updated to the scoped testids
This commit is contained in:
2026-09-20 21:26:16 +00:00
parent 57cc6705f2
commit 1e3992f872
7 changed files with 663 additions and 14 deletions
+6 -4
View File
@@ -466,14 +466,16 @@ export default function LeftPane({ state, loading, error, onRefresh, applySnapsh
add control reusing this pane's already-fetched airport options (no second fetch). */}
<div className="queue-subsection">
<span className="queue-heading">Queue</span>
{/* ISS-055 (v0.31.0): testids scoped by plane id — with two on-board blocks the
unscoped ids duplicated in the DOM and broke Playwright strict mode. */}
{plane.queue.map((icao, i) => (
<div key={`${icao}-${i}`} data-testid={`queue-leg-${i}`} className="queue-row">
<div key={`${icao}-${i}`} data-testid={`queue-leg-${plane.id}-${i}`} className="queue-row">
<span className="contract-route">
{airportOptions?.find((a) => a.icao === icao)?.name ?? icao} ({icao})
</span>
<button
type="button"
data-testid={`queue-cancel-${i}`}
data-testid={`queue-cancel-${plane.id}-${i}`}
className="pane-btn"
disabled={actionsBusy}
onClick={() => void runAction(`/api/planes/${plane.id}/queue/cancel`, { index: i })}
@@ -484,7 +486,7 @@ export default function LeftPane({ state, loading, error, onRefresh, applySnapsh
))}
<div className="market-row">
<select
data-testid="queue-add-dest"
data-testid={`queue-add-dest-${plane.id}`}
aria-label="Airport to add to the flight queue"
value={queueAddDestIcao ?? ''}
onChange={(e) => setQueueAddDestIcao(e.target.value || null)}
@@ -498,7 +500,7 @@ export default function LeftPane({ state, loading, error, onRefresh, applySnapsh
</select>
<button
type="button"
data-testid="queue-add"
data-testid={`queue-add-${plane.id}`}
className="pane-btn"
disabled={actionsBusy || queueAddDestIcao === null}
onClick={() => {