feat: v0.9.0 — single-screen 3-pane shell + left Assets pane (wallet/reputation/fleet/time controls) from a single /api/state poll; right pane placeholder
This commit is contained in:
+27
-20
@@ -51,15 +51,15 @@ test('clicking an airport marker opens a popup with name and ICAO', async ({ pag
|
||||
{ timeout: 15_000 },
|
||||
).toBeGreaterThan(0);
|
||||
|
||||
// Project UKBB (Boryspil) to screen space via the dev hook, then click it.
|
||||
// Boryspil is used because with only large_airport rows remaining it is the
|
||||
// most isolated marker inside the initial zoom-4 viewport: its nearest
|
||||
// surviving airport is Chişinău (LUKK), ~126 px away at the initial zoom
|
||||
// (Kyiv Zhuliany, geographically closer, was a medium_airport and got cut),
|
||||
// so its marker cannot be overlapped by a neighbouring circle.
|
||||
// Project LFRS (Nantes Atlantique) to screen space via the dev hook, then click it.
|
||||
// Nantes is used because the v0.9.0 three-pane layout narrows the map column to ~660 px at
|
||||
// the default 1280×720 viewport, which puts UKBB Boryspil (~475 px east of the [10,52] center)
|
||||
// outside the initial view; LFRS is now the most isolated large_airport marker inside it — its
|
||||
// nearest neighbour is LFRB Nantes–Montoir ~78 px away at the initial zoom, so its marker cannot
|
||||
// be overlapped by a neighbouring circle.
|
||||
const pt = await page.evaluate(() => {
|
||||
const map = (window as any).__flightMap;
|
||||
const p = map.project([30.894699, 50.345001]);
|
||||
const p = map.project([-1.61073, 47.153198]); // LFRS Nantes Atlantique — see the marker-click test above for why
|
||||
const rect = map.getContainer().getBoundingClientRect();
|
||||
return { x: rect.left + p.x, y: rect.top + p.y };
|
||||
});
|
||||
@@ -67,8 +67,8 @@ test('clicking an airport marker opens a popup with name and ICAO', async ({ pag
|
||||
|
||||
const popup = page.getByTestId('airport-popup');
|
||||
await expect(popup).toBeVisible();
|
||||
await expect(popup).toContainText('Boryspil International Airport');
|
||||
await expect(popup).toContainText('UKBB');
|
||||
await expect(popup).toContainText('Nantes Atlantique Airport');
|
||||
await expect(popup).toContainText('LFRS');
|
||||
});
|
||||
|
||||
test('wheel zoom is clamped between min and max zoom', async ({ page }) => {
|
||||
@@ -185,14 +185,21 @@ test('style switcher defaults to Fiord, switches styles, and keeps the airports
|
||||
await expect.poll(renderedCircles, { timeout: 15_000 }).toBeGreaterThan(0);
|
||||
|
||||
// Clicking a marker after the switch opens exactly one popup (the click handler is
|
||||
// re-wired idempotently — no duplicate listeners).
|
||||
const pt = await page.evaluate(() => {
|
||||
const map = (window as any).__flightMap;
|
||||
const p = map.project([30.894699, 50.345001]); // UKBB Boryspil
|
||||
const rect = map.getContainer().getBoundingClientRect();
|
||||
return { x: rect.left + p.x, y: rect.top + p.y };
|
||||
});
|
||||
await page.mouse.click(pt.x, pt.y);
|
||||
// re-wired idempotently — no duplicate listeners). MapLibre's diff-based setStyle removes our
|
||||
// custom source/layer before ensureAirportsLayer re-adds it on the next styledata event, so
|
||||
// retry the click until the popup opens instead of asserting on a single shot (the marker is
|
||||
// clickable again within milliseconds; toHaveCount(1) below still catches duplicate listeners).
|
||||
await expect.poll(async () => {
|
||||
const pt = await page.evaluate(() => {
|
||||
const map = (window as any).__flightMap;
|
||||
const p = map.project([-1.61073, 47.153198]); // LFRS Nantes Atlantique — see the marker-click test above for why
|
||||
const rect = map.getContainer().getBoundingClientRect();
|
||||
return { x: rect.left + p.x, y: rect.top + p.y };
|
||||
});
|
||||
await page.mouse.click(pt.x, pt.y);
|
||||
return (await page.getByTestId('airport-popup').count()) > 0;
|
||||
}, { timeout: 15_000 }).toBe(true);
|
||||
|
||||
const popups = page.getByTestId('airport-popup');
|
||||
await expect(popups.first()).toBeVisible();
|
||||
await expect(popups).toHaveCount(1);
|
||||
@@ -248,7 +255,7 @@ test('falls back to remote OFM styles when the local asset pack is absent', asyn
|
||||
|
||||
const pt = await page.evaluate(() => {
|
||||
const map = (window as any).__flightMap;
|
||||
const p = map.project([30.894699, 50.345001]); // UKBB Boryspil
|
||||
const p = map.project([-1.61073, 47.153198]); // LFRS Nantes Atlantique — see the marker-click test above for why
|
||||
const rect = map.getContainer().getBoundingClientRect();
|
||||
return { x: rect.left + p.x, y: rect.top + p.y };
|
||||
});
|
||||
@@ -256,6 +263,6 @@ test('falls back to remote OFM styles when the local asset pack is absent', asyn
|
||||
|
||||
const popup = page.getByTestId('airport-popup');
|
||||
await expect(popup).toBeVisible();
|
||||
await expect(popup).toContainText('Boryspil International Airport');
|
||||
await expect(popup).toContainText('UKBB');
|
||||
await expect(popup).toContainText('Nantes Atlantique Airport');
|
||||
await expect(popup).toContainText('LFRS');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user