test(e2e): embed固有(wrapper-only)のE2Eを追加#496
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (13)
📝 WalkthroughWalkthroughembed固有(wrapper-only)のE2Eテスト基盤を新規構築。グローバルAPI公開、DOM自動レンダリング、data属性フォワーディング、遅延読み込み、プラグインシステム、クリーンアップ、iframe権限、pmtilesプロトコルの8つの機能領域に対応するHTMLデモページ5つとPlaywrightテストスペック9つを追加。 ChangesEmbed固有E2Eテストスイート
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
smellman
left a comment
There was a problem hiding this comment.
LGTM!
どこがe2eで担保できないのかがわかりやすくなっていて良いと思いました。
yuiseki
left a comment
There was a problem hiding this comment.
E2E 追加ありがとうございます。各 spec の冒頭に「これは embed (wrapper) 固有の挙動で、表示・機能そのものは maps-core 側 E2E が担保する」という責任境界がコメントで明記されていて、#494 の分担意図がコードだけ読んでも追えるのがとても良いです 🙌
特に良かった点:
- auto-render の「DOMContentLoaded 後に追加した
.geoloniaは拾われない (one-shot)」という negative test。ハッピーパスだけでなく挙動の境界を押さえていて、renderGeoloniaMapの一度きり走査という仕様を正確に固定できています。 - cleanup の「同一コンテナへ再
newすると同一インスタンスが返る」で二重初期化防止まで担保している点。 - skip した iframe 拒否ケース / pmtiles 登録を silent に落とさず、理由と「どこで担保すべきか(
checkPermissionのユニット / maps-core)」まで書いてあるのが誠実で助かります。
production コード変更ゼロ・削除ゼロで、狙いどおり wrapper-only の回帰検知に絞れています。E2E も CI で pass しているので LGTM です。
nit(ブロッキングではないです):
- auto-render one-shot と lazy 未初期化の negative test で
waitForTimeout(500/300)を使っている箇所は、「起きないこと」の確認なので固定待ちは妥当な判断だと思います。将来 flaky になるようなら、別の観測可能なシグナル待ちに置き換える余地はありそうです。ご判断にお任せします。
概要
#494 の実装。maps-core が担保する表示・機能とは別に、embed (wrapper) 固有の挙動だけを守る E2E を追加する。
(責任分担: 機能・表示は maps-core
e2e/、embed は wrapper グルー専任。詳細は E2E-for-Embed-Only-Features)複数のテストが1つの PR に混在するため、ファイル ↔ テスト ↔ #494 項目 の対応を以下に明記する。
ファイル対応表
spec(
e2e/)e2e/globals.spec.tsdocs/e2e/basic.html(既存)window.geoloniaの形(Map/Marker/SimpleStyle/registerPlugin/embedVersion)/maplibregl・mapboxglが同一参照e2e/auto-render.spec.tsdocs/e2e/multiple-maps.html.geoloniaの独立描画 / DOMContentLoaded 後追加は auto-render されない(one-shot).geoloniaauto-rendere2e/data-attributes.spec.tsdocs/e2e/data-attributes.htmldata-lat/lng/zoom/bearing/pitch→GeoloniaMapOptionsフォワーディングe2e/lazy-loading.spec.tsdocs/e2e/lazy-loading.htmldata-lazy-loading="off"即時初期化 / デフォルトは lazy(スクロールで初期化)e2e/cleanup.spec.tsdocs/e2e/cleanup.htmlmap.remove()発火 / 二重 new で同一インスタンスe2e/plugin.spec.tsdocs/e2e/plugin.htmlregisterPluginの callback が全 map に(map, target, atts)で発火e2e/iframe.spec.tsdocs/e2e/basic.html(既存)e2e/pmtiles.spec.tsfixture(
docs/e2e/、新規)docs/e2e/multiple-maps.htmldocs/e2e/data-attributes.htmldocs/e2e/lazy-loading.htmldocs/e2e/cleanup.htmldocs/e2e/plugin.html※ すべての fixture はテスト用公開キー
?geolonia-api-key=YOUR-API-KEYを使用(API キーは必須)。skip しているテスト(silent に落とさず明示)
iframe.spec.ts「iframe + API key 無し → 拒否される」checkPermission()のユニットテストで担保すべき。pmtiles.spec.ts「pmtiles プロトコル登録」結果
メモ
Closes #494
Part of #411
Summary by CodeRabbit
リリースノート
Documentation
Tests