@@ -9,18 +9,18 @@ declare global {
99async function goTo ( page : Page , url : string ) : Promise < any > {
1010 await page . goto ( url ) ;
1111 // ページ内のスクリプト実行完了まで待機し、window._map を取得
12- await page . waitForFunction ( ( ) => ( window as any ) . _map !== undefined , { timeout : 10000 } ) ;
12+ await page . waitForFunction ( ( ) => window . _map !== undefined , { timeout : 10000 } ) ;
1313}
1414
1515test ( 'should display map with center (35.6798619, 139.7648345) and zoom level 16' , async ( { page } ) => {
1616
17+ // ページが読み込まれるまで待機
1718 await goTo ( page , 'http://localhost:3000/index.html' ) ;
1819
19- // ページが読み込まれるまで待機
2020 const mapState = await page . evaluate ( ( ) => {
2121 return {
22- center : ( window as any ) . _map . getCenter ( ) , // マップの中心座標を取得
23- zoom : ( window as any ) . _map . getZoom ( ) , // ズームレベルを取得
22+ center : window . _map . getCenter ( ) , // マップの中心座標を取得
23+ zoom : window . _map . getZoom ( ) , // ズームレベルを取得
2424 } ;
2525 } ) ;
2626
@@ -29,7 +29,7 @@ test('should display map with center (35.6798619, 139.7648345) and zoom level 16
2929 expect ( mapState . center . lng ) . toBeCloseTo ( 139.7648345 , 5 ) ;
3030 expect ( mapState . zoom ) . toBe ( 16 ) ;
3131
32- // マーカーの存在確認(デフォルトマーカーがあるか)
32+ // マーカーの存在確認
3333 const marker = await page . waitForSelector ( '.geolonia-default-marker' , { timeout : 10000 } ) ;
3434 expect ( marker ) . not . toBeNull ( ) ;
3535} ) ;
0 commit comments