mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-30 16:33:16 +00:00
30 lines
1.4 KiB
TypeScript
30 lines
1.4 KiB
TypeScript
import { test, expect } from '@playwright/test'
|
|
import { dismissSystemNotices } from './helpers'
|
|
|
|
// Open a trip into the planner: create a trip, open it from the dashboard, and
|
|
// confirm the trip planner (TripPlannerPage — the app's largest page) actually
|
|
// mounts, proving the day-plan/map shell renders rather than crashing on load.
|
|
test('open a trip and land in the planner with a map', async ({ page }) => {
|
|
await page.goto('/dashboard')
|
|
|
|
// The release notice greets a freshly seeded user and its backdrop eats the click below.
|
|
await dismissSystemNotices(page)
|
|
|
|
// Create a trip to open.
|
|
await page.locator('.add-trip-card').click()
|
|
const modal = page.locator('.trek-modal-backdrop')
|
|
await expect(modal).toBeVisible()
|
|
// Target Title by placeholder: the cover-image search inputs sit above it, so
|
|
// input[type=text].first() is the photo search box, not the field we want.
|
|
const title = `E2E Planner ${Date.now()}`
|
|
await modal.getByPlaceholder('e.g. Summer in Japan').fill(title)
|
|
await modal.getByRole('button', { name: 'Create New Trip' }).click()
|
|
|
|
// Open it from the dashboard.
|
|
await page.getByText(title).first().click()
|
|
|
|
await expect(page).toHaveURL(/\/trips\/\d+/)
|
|
// The planner shows its configured map once mounted.
|
|
await expect(page.locator('.leaflet-container, .maplibregl-canvas, .mapboxgl-canvas').first()).toBeVisible({ timeout: 20_000 })
|
|
})
|