mirror of
https://github.com/hanzo-apps/world.git
synced 2026-10-30 14:53:09 +00:00
Map controls: - Projection (2D/3D), basemap (Dark/Sat/Terrain) and time-range each collapse into ONE compact dropdown (trigger shows the active value + caret; options in a popover). The top dock is now a single tidy row of three instead of two wrapping rows. Global .deckgl-dd treatment (one way, every map host). e2e specs open the dropdown before clicking an option via a shared clickMapControl helper. Panel symmetry (real data, never padded): - Live Traffic: added a real 4th tile (distinct countries with traffic) → 2×2. - Model Improvement: split scored-events into its own tile → 2×2 (reward rate, requests scored, active days, retrains). - Cloud Overview / Global Platform: dropped the 'regions' tile (fleet carries region detail) per CTO. - New .cloud-stat-grid-2 (exactly two columns) for the symmetric 2×2 layout. Co-authored-by: Hanzo Dev <[email protected]>
19 lines
980 B
TypeScript
19 lines
980 B
TypeScript
import type { Page, Locator } from '@playwright/test';
|
|
|
|
// The map's projection / basemap / time-range controls collapsed into dropdowns:
|
|
// each option button (.proj-btn / .style-btn / .time-btn) lives in a popover that a
|
|
// trigger opens. Tests that click an option must open its dropdown first. This helper
|
|
// opens the button's parent .deckgl-dd (if it's in one) and clicks the option — a
|
|
// no-op open when the button isn't inside a dropdown, so it's safe everywhere.
|
|
export async function clickMapControl(page: Page, buttonSelector: string): Promise<void> {
|
|
const btn: Locator = page.locator(buttonSelector).first();
|
|
const dd = btn.locator('xpath=ancestor::div[contains(concat(" ", normalize-space(@class), " "), " deckgl-dd ")][1]');
|
|
if (await dd.count()) {
|
|
const trigger = dd.locator('.dd-trigger').first();
|
|
if (!(await dd.evaluate((el) => el.classList.contains('open')).catch(() => false))) {
|
|
await trigger.click();
|
|
}
|
|
}
|
|
await btn.click();
|
|
}
|