Skip to content

Commit 5b0ba09

Browse files
committed
test(e2e): add routing warnings test
1 parent b5af8c9 commit 5b0ba09

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

e2e/map.spec.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,35 @@ test.describe('Map interactions with left context menu', () => {
536536
);
537537
expect(clipboardContent).toBe('13.393707,52.518310');
538538
});
539+
540+
test('should show routing warning toast when API returns warnings', async ({
541+
page,
542+
}) => {
543+
await setupNominatimMock(page);
544+
545+
const mockResponse = JSON.parse(JSON.stringify(customRouteResponse));
546+
mockResponse.warnings = [{ code: 1, message: 'Test routing warning' }];
547+
548+
await setupRouteMock(page, mockResponse);
549+
550+
await page
551+
.getByRole('region', { name: 'Map' })
552+
.click({ button: 'right', position: { x: 800, y: 100 }, force: true });
553+
554+
await page.getByRole('button', { name: 'Directions from here' }).click();
555+
556+
await expect(
557+
page.getByLabel('Map marker 1').getByRole('img')
558+
).toBeVisible();
559+
560+
await page
561+
.getByRole('region', { name: 'Map' })
562+
.click({ button: 'right', position: { x: 800, y: 300 }, force: true });
563+
564+
await page.getByRole('button', { name: 'Directions to here' }).click();
565+
566+
await expect(page.getByText('Test routing warning')).toBeVisible();
567+
});
539568
});
540569

541570
test.describe('Map interactions with URL parameters', () => {

0 commit comments

Comments
 (0)