11import { test , expect } from "@playwright/test"
22
3- test ( "map loads and Zurich meetup link works" , async ( { page } ) => {
3+ test . beforeEach ( async ( { page } ) => {
44 await page . goto ( "/community/events" )
5+ } )
56
7+ test ( "Zurich meetup link works" , async ( { page } ) => {
68 const mapCanvas = page . locator ( "canvas" ) . first ( )
79 await expect ( mapCanvas ) . toBeVisible ( { timeout : 10000 } )
810
@@ -15,16 +17,13 @@ test("map loads and Zurich meetup link works", async ({ page }) => {
1517
1618 const mapContainer = page . locator ( "#meetups-map" )
1719 await mapContainer . focus ( )
18- await expect ( mapContainer . locator ( "canvas" ) . first ( ) ) . toHaveScreenshot (
19- "meetups-map.png" ,
20- { timeout : 10_000 } ,
21- )
2220
2321 const pastEventsSection = page . locator ( "text=Past events & meetups" )
2422 await pastEventsSection . scrollIntoViewIfNeeded ( )
2523
2624 const link = page . getByRole ( "link" , { name : / Z u r i c h / i } ) . first ( )
2725 await link . scrollIntoViewIfNeeded ( )
26+
2827 await link . click ( )
2928
3029 const pagePromise = page . context ( ) . waitForEvent ( "page" )
@@ -35,8 +34,16 @@ test("map loads and Zurich meetup link works", async ({ page }) => {
3534 expect ( newPage . url ( ) ) . toContain ( "meetup.com/graphql-zurich" )
3635} )
3736
37+ test ( "map matches screenshot" , async ( { page } ) => {
38+ const mapContainer = page . locator ( "#meetups-map" ) . first ( )
39+ await mapContainer . scrollIntoViewIfNeeded ( )
40+ await expect ( mapContainer . locator ( "canvas" ) . first ( ) ) . toHaveScreenshot (
41+ "meetups-map.png" ,
42+ { timeout : 15_000 } ,
43+ )
44+ } )
45+
3846test ( "map tooltip appears on marker hover" , async ( { page } ) => {
39- await page . goto ( "/community/events" )
4047 const mapContainer = page . locator ( "#meetups-map" ) . first ( )
4148 await mapContainer . scrollIntoViewIfNeeded ( )
4249 await expect ( mapContainer ) . toBeVisible ( { timeout : 10000 } )
0 commit comments