test(e2e): backport maps-core PR #81 — robust minimal style fixture#492
Merged
Conversation
E2E flaky 対策。maps-core PR #81 と同じ解決策を embed の helper に backport。 - e2e/helper.ts の mockGeoloniaTiles が返す minimal style を強化: - glyphs フィールド (symbol layer が silently skip されないため必須) - dummy fixture source + attribution (attribution テストで集計対象を作る) - background + fixture fill レイヤ - e2e/sample.spec.ts の期待 layers を ['background', 'fixture'] に更新 - docs/e2e/sample-basic-style.json を新規追加。後続フェーズで data-style="./sample-basic-style.json" として参照可能 10/10 グリーン確認済み。external-style.spec.ts は smoke として外部 URL を保持。 Closes #490 Part of #411
|
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 (3)
📝 WalkthroughWalkthroughE2E テストの最小スタイル定義を Mapbox Style v8 互換の完全形式に統一。新しい参照スタイル JSON を導入し、mock ヘルパーを拡張してそれに合わせ、テスト期待値を更新した。 ChangesE2E最小スタイル統一
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #490
Part of #411
Summary
maps-core PR geolonia/maps-core#81 で適用された E2E flaky 対策と同じ解決策を embed の helper に backport。
embed の E2E は現状 4 spec / 10 ケースで外部依存は
external-style.spec.ts(smoke) のみだが、mockGeoloniaTilesが返す minimal style が以下の点で robust ではなかった:glyphsフィールド未設定 → MapLibre が symbol layer の add を silently skip する条件attributionを持つ source が無い → attribution 取得テストで集計対象が空将来の Phase 1a 以降 (data 属性、marker/popup、コントロール、SimpleStyle 等) で symbol layer や attribution を使うテストが追加されたときに flaky 化する前に予防的に修正する。
変更内容
e2e/helper.tsmockGeoloniaTilesが返す minimal style を maps-core のsample-basic-style.jsonと同等構造に:{ "version": 8, "glyphs": "/glyphs/{fontstack}/{range}.pbf", "sources": { "fixture": { "type": "geojson", "data": { "type": "FeatureCollection", "features": [] }, "attribution": "<a href=\"https://example.com\">Test fixture</a>" } }, "layers": [ { "id": "background", "type": "background", "paint": { "background-color": "#cccccc" } }, { "id": "fixture", "type": "fill", "source": "fixture", "paint": { "fill-color": "#cccccc" } } ] }e2e/sample.spec.tsgetStyleLayerIdsの期待値を['background', 'fixture']に更新。docs/e2e/sample-basic-style.json(新規)同一の fixture を JSON ファイルとしても配置。後続フェーズで HTML テストページから
data-style="./sample-basic-style.json"で参照可能。維持する外部依存
maps-core PR #81 と同じ方針で、
external-style.spec.tsは外部 URL (tile.openstreetmap.jp) のままにする。外部 fetch 検証が目的のため。Test plan
npm run e2e -- --reporter=listで 10/10 グリーンexternal-style.spec.tsも pass (外部 URL のまま動作)Summary by CodeRabbit
新機能
テスト
ドキュメント