test: add M9-M11 stories map + MUX1-5 panel/sort/fullscreen regression tests
This commit is contained in:
@@ -125,3 +125,39 @@ test('M8: home map has a journey source after GPX settles (active trip)', async
|
||||
expect(hasSource, 'Home map has a journey or GPX source').toBe(true);
|
||||
expect(errors, 'No JS errors on home page').toHaveLength(0);
|
||||
});
|
||||
|
||||
// ── M9: Stories mini-map renders MapLibre canvas ──────────────────────────────
|
||||
test('M9: Stories mini-map renders MapLibre GL canvas without JS errors', async ({ page }) => {
|
||||
const errors = [];
|
||||
page.on('pageerror', e => errors.push(e.message));
|
||||
|
||||
await page.goto('/trips/italy-2026-demo/stories');
|
||||
await expect(page.locator('#stories-map canvas.maplibregl-canvas')).toBeVisible({ timeout: 10000 });
|
||||
expect(errors, 'No JS errors on stories page').toHaveLength(0);
|
||||
});
|
||||
|
||||
// ── M10: Stories mini-map has at least one story marker ──────────────────────
|
||||
test('M10: Stories mini-map has at least one story marker', async ({ page }) => {
|
||||
await page.goto('/trips/italy-2026-demo/stories');
|
||||
await expect(page.locator('#stories-map canvas.maplibregl-canvas')).toBeVisible({ timeout: 10000 });
|
||||
await expect(page.locator('#stories-map .maplibregl-marker').first()).toBeVisible({ timeout: 15000 });
|
||||
|
||||
const markerCount = await page.locator('#stories-map .maplibregl-marker').count();
|
||||
expect(markerCount, 'At least one story marker').toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
// ── M11: Dailies attribution control starts collapsed ─────────────────────────
|
||||
test('M11: Dailies mini-map attribution starts collapsed (no open attribute)', async ({ page }) => {
|
||||
await page.goto('/trips/italy-2026-demo/dailies');
|
||||
await expect(page.locator('#feed-map canvas.maplibregl-canvas')).toBeVisible({ timeout: 10000 });
|
||||
// Wait for markers (added in map.on('load')) to ensure the load callback has run,
|
||||
// which is also where removeAttribute('open') executes.
|
||||
await expect(page.locator('#feed-map .maplibregl-marker').first()).toBeVisible({ timeout: 15000 });
|
||||
await expect(page.locator('#feed-map .maplibregl-ctrl-attrib')).toBeVisible({ timeout: 10000 });
|
||||
|
||||
const hasOpen = await page.evaluate(function () {
|
||||
var attrib = document.querySelector('#feed-map .maplibregl-ctrl-attrib');
|
||||
return attrib ? attrib.hasAttribute('open') : null;
|
||||
});
|
||||
expect(hasOpen, 'Attribution is collapsed (no open attribute)').toBe(false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user