feat: tests & bootstrap

This commit is contained in:
Anatoly Antonov 2026-04-22 02:26:43 +09:00
parent 4bd927bb4e
commit 79e20ca37c
19 changed files with 706 additions and 23 deletions

31
tests/e2e/smoke.spec.ts Normal file
View file

@ -0,0 +1,31 @@
import { test, expect, login } from './fixtures';
test.beforeEach(async ({ context }) => {
await login(context);
});
test('predict page loads and mounts the MapLibre canvas', async ({ page }) => {
await page.goto('/predict');
await expect(page.locator('.map-container canvas').first()).toBeAttached({
timeout: 15_000,
});
});
test('left and right panels are visible on predict', async ({ page }) => {
await page.goto('/predict');
await expect(page.locator('.panel-container-left')).toBeVisible();
await expect(page.locator('.panel-container-right')).toBeVisible();
});
test('navbar shows current username dropdown when authenticated', async ({ page }) => {
await page.goto('/predict');
await expect(page.getByRole('link', { name: /Прогноз|Predict/ }).first()).toBeVisible();
await expect(page.getByText('demo').first()).toBeVisible();
});
test('tracking page mounts its own map', async ({ page }) => {
await page.goto('/track');
await expect(page.locator('.map-container canvas').first()).toBeAttached({
timeout: 15_000,
});
});