@@ -98,7 +98,12 @@ const GEOLONIA_TILE_PBF_REGEX = new RegExp(
9898 * Geolonia のスタイル/タイル/スプライト等を最小レスポンスでモックする。
9999 * テスト先頭の beforeEach で呼ぶ前提。
100100 *
101- * 返すスタイルは layers=[background] のみのミニマル style v8。
101+ * 返すスタイルは maps-core の sample-basic-style.json (PR #81) に揃えた
102+ * minimal style v8。具体的には:
103+ * - `glyphs` フィールド (symbol layer が silently skip されないため必須)
104+ * - dummy `fixture` source + attribution (attribution テストで集計対象を作る)
105+ * - background + fixture fill レイヤ
106+ *
102107 * 認証URL検証など transformRequest の挙動は実リクエスト前にここで握る。
103108 */
104109export async function mockGeoloniaTiles ( page : Page ) {
@@ -109,15 +114,24 @@ export async function mockGeoloniaTiles(page: Page) {
109114 contentType : 'application/json' ,
110115 body : JSON . stringify ( {
111116 version : 8 ,
112- sources : { } ,
117+ glyphs : '/glyphs/{fontstack}/{range}.pbf' ,
118+ sources : {
119+ fixture : {
120+ type : 'geojson' ,
121+ data : { type : 'FeatureCollection' , features : [ ] } ,
122+ attribution : '<a href="https://example.com">Test fixture</a>' ,
123+ } ,
124+ } ,
113125 layers : [
114126 { id : 'background' , type : 'background' , paint : { 'background-color' : '#cccccc' } } ,
127+ { id : 'fixture' , type : 'fill' , source : 'fixture' , paint : { 'fill-color' : '#cccccc' } } ,
115128 ] ,
116129 } ) ,
117130 } ) ,
118131 ) ;
119132
120- // スプライト / グリフ / フォント関連は 404 でよい (background のみなので参照されない)
133+ // スプライト / グリフ / フォント関連は 404 でよい (実体は不要だが minimal style 内の
134+ // glyphs path に対するリクエストが net error にならないよう route で握る)
121135 await page . route ( / c d n \. g e o l o n i a \. c o m \/ ( s p r i t e | g l y p h | f o n t ) / , ( route ) =>
122136 route . fulfill ( { status : 404 , body : '' } ) ,
123137 ) ;
0 commit comments