Restore dual-map regression coverage

This commit is contained in:
Morten V. Christiansen 2026-04-07 14:56:54 +02:00
parent 4e51c2faad
commit 8320ea66b9
1 changed files with 41 additions and 0 deletions

View File

@ -36,6 +36,47 @@ test.describe('kort7 dual map demo', () => {
await expect(selection).toContainText('hjørneindikator'); await expect(selection).toContainText('hjørneindikator');
}); });
test('renders uncertainty circles on the maps', async ({ page }) => {
await page.goto('/kort7.html');
await waitForMaps(page);
await expect.poll(async () => {
return await page.locator('path').evaluateAll((nodes) =>
nodes.filter((node) => {
const strokeDasharray = node.getAttribute('stroke-dasharray');
return strokeDasharray && strokeDasharray.length > 0;
}).length
);
}).toBeGreaterThan(0);
});
test('shows off-map indicators on both views', async ({ page }) => {
await page.goto('/kort7.html');
await expect(page.locator('#offmapIndicatorsApprox .offmap-indicator')).toHaveCount(2);
await expect(page.locator('#offmapIndicatorsTrue .offmap-indicator')).toHaveCount(2);
await expect(page.locator('#offmapIndicatorsApprox')).toContainText('Bil 9');
await expect(page.locator('#offmapIndicatorsTrue')).toContainText('Bil 10');
});
test('approximate and precise positions differ for the same vehicle', async ({ page }) => {
await page.goto('/kort7.html');
await page.getByRole('button', { name: 'Pause' }).click();
const selection = page.locator('#selectedVehicleInfo');
const approxIndicator = page.locator('#offmapIndicatorsApprox .offmap-indicator').filter({ hasText: 'Bil 9' });
await approxIndicator.click();
const approxText = await selection.textContent();
const trueIndicator = page.locator('#offmapIndicatorsTrue .offmap-indicator').filter({ hasText: 'Bil 9' });
await trueIndicator.click();
const trueText = await selection.textContent();
expect(approxText).not.toEqual(trueText);
expect(approxText).toContain('Tilnærmet position');
expect(trueText).toContain('Præcis position');
});
test('playback updates simulation status over time', async ({ page }) => { test('playback updates simulation status over time', async ({ page }) => {
await page.goto('/kort7.html'); await page.goto('/kort7.html');
const status = page.locator('#status'); const status = page.locator('#status');