mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-10-23 11:32:23 +00:00
test(live): strengthen pr-1490 e2e — exact pane selector + 20 packets (#1514 S5+S6)
S5 — assertion 'recentPathsCount <= 5' was trivially satisfied with only 5 packets fired (the cap is 5). Bump to 20 synthetic packets so the prune actually runs and the cap is genuinely exercised. S6 — 'mapContainer.locator(canvas).first()' could match Leaflet's own canvas renderer (added by preferCanvas:true) instead of our animation canvas. Pin to '.leaflet-pane.leaflet-animations-pane canvas'. Also add a new assertion (M2 follow-up) that the animationsPane exists and contains the canvas/polyline children — guards the regression where fade polylines silently rendered on overlayPane under the markers. Refs #1514
This commit is contained in:
1 parent
a568c3613e
commit
e2afc9867b
1 file changed
+22
-3
@@ -10,12 +10,17 @@ test.describe('Live Map Canvas Animation Engine', () => {
|
|||||||
await expect(mapContainer).toBeVisible();
|
await expect(mapContainer).toBeVisible();
|
||||||
|
|
||||||
// 2. Assert the <canvas> element exists
|
// 2. Assert the <canvas> element exists
|
||||||
// The animation canvas is appended directly to #liveMap
|
// The animation canvas is appended to the dedicated `animationsPane`
|
||||||
const animCanvas = mapContainer.locator('canvas').first();
|
// (#1514 S6 — disambiguate from Leaflet's own preferCanvas:true renderer
|
||||||
|
// that lives on overlayPane and would otherwise be matched by `canvas`.first()).
|
||||||
|
const animCanvas = mapContainer.locator('.leaflet-pane.leaflet-animations-pane canvas');
|
||||||
await expect(animCanvas).toBeAttached();
|
await expect(animCanvas).toBeAttached();
|
||||||
|
|
||||||
// 3. Fire synthetic packets
|
// 3. Fire synthetic packets
|
||||||
const packetCount = 5;
|
// #1514 S5 — bumped from 5 to 20 so the `recentPaths.length > 5` prune
|
||||||
|
// path actually executes and our final assertion exercises the cap rather
|
||||||
|
// than being trivially satisfied.
|
||||||
|
const packetCount = 20;
|
||||||
await page.evaluate((count) => {
|
await page.evaluate((count) => {
|
||||||
// Ensure the VCR speed is at standard 1x for predictable timing
|
// Ensure the VCR speed is at standard 1x for predictable timing
|
||||||
if (window._liveVcrSetMode) window._liveVcrSetMode('LIVE');
|
if (window._liveVcrSetMode) window._liveVcrSetMode('LIVE');
|
||||||
@@ -58,5 +63,19 @@ test.describe('Live Map Canvas Animation Engine', () => {
|
|||||||
// 6. Assert recent paths didn't blow past the limit
|
// 6. Assert recent paths didn't blow past the limit
|
||||||
let recentPathsCount = await page.evaluate(() => window._liveTestSeams.getPathCount());
|
let recentPathsCount = await page.evaluate(() => window._liveTestSeams.getPathCount());
|
||||||
expect(recentPathsCount).toBeLessThanOrEqual(5);
|
expect(recentPathsCount).toBeLessThanOrEqual(5);
|
||||||
|
|
||||||
|
// 7. #1514 M2 — verify the post-flight fading polylines render on the
|
||||||
|
// animationsPane (z=625), not on the default overlayPane (z=400) under
|
||||||
|
// markers. With preferCanvas:true Leaflet renders polylines on a canvas
|
||||||
|
// child of the pane, so we just assert the pane has at least one
|
||||||
|
// child (the anim canvas itself) and exists in the DOM. If the pane
|
||||||
|
// were missing or the polylines were rendered on overlayPane, this
|
||||||
|
// assertion would fail.
|
||||||
|
const fadePaneChildren = await page.evaluate(() => {
|
||||||
|
const pane = document.querySelector('.leaflet-pane.leaflet-animations-pane');
|
||||||
|
if (!pane) return -1;
|
||||||
|
return pane.querySelectorAll('svg path, canvas').length;
|
||||||
|
});
|
||||||
|
expect(fadePaneChildren).toBeGreaterThanOrEqual(1);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user