Skip to content

Commit 548ffa1

Browse files
committed
some fix
1 parent 107537e commit 548ffa1

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

tests/html/index.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
<meta charset="UTF-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<title>Geolonia Map</title>
7+
<title>Geolonia Map E2E Test</title>
88
<style>
9-
html,
10-
body,
11-
#map {
9+
html,body, #map {
1210
width: 100%;
1311
height: 100%;
1412
padding: 0;

tests/index.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ declare global {
99
async 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

1515
test('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

Comments
 (0)