Skip to content

Commit 28d25fc

Browse files
woodroofgithub-actions[bot]
authored andcommitted
New render tests for clip layer and nested imports
GitOrigin-RevId: fb58a92baeec8f758f05345e6cfb903774756181
1 parent 5cb89b4 commit 28d25fc

File tree

9 files changed

+508
-0
lines changed

9 files changed

+508
-0
lines changed

test/ignores/all.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,12 @@ const skip = [
282282
// Not implemented, https://mapbox.atlassian.net/browse/GLJS-1591
283283
"render-tests/slots/inner-slot-before-outer",
284284
"render-tests/slots/mixed-slot-order-with-imports",
285+
286+
// https://mapbox.atlassian.net/browse/GLJS-1696
287+
"render-tests/imports/nested-imports",
288+
289+
// https://mapbox.atlassian.net/browse/GLJS-1698
290+
"render-tests/clip-layer/clip-symbols-with-imports"
285291
];
286292

287293
export default {todo, skip};
3 KB
Loading
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"version": 8,
3+
"metadata": {
4+
"test": {
5+
"height": 128,
6+
"width": 128
7+
}
8+
},
9+
"zoom": 1.5,
10+
"sprite": "local://sprites/sprite",
11+
"sources": {
12+
"points": {
13+
"type": "geojson",
14+
"data": {
15+
"type": "GeometryCollection",
16+
"geometries": [
17+
{
18+
"type": "Point",
19+
"coordinates": [0, 0]
20+
},
21+
{
22+
"type": "Point",
23+
"coordinates": [10, 10]
24+
}
25+
]
26+
}
27+
},
28+
"polygon": {
29+
"type": "geojson",
30+
"data": {
31+
"type": "Polygon",
32+
"coordinates": [[[-5, -5], [-5, 5], [5, 5], [5, -5], [-5, -5]]]
33+
}
34+
}
35+
},
36+
"layers": [
37+
{
38+
"id": "background",
39+
"type": "background",
40+
"paint": {
41+
"background-color": "white"
42+
}
43+
},
44+
{
45+
"id": "polygon",
46+
"type": "fill",
47+
"source": "polygon",
48+
"paint": {
49+
"fill-color": "rgba(0, 0, 255, 0.1)"
50+
}
51+
},
52+
{
53+
"id": "symbol",
54+
"type": "symbol",
55+
"source": "points",
56+
"layout": {
57+
"icon-image": "rocket-12"
58+
}
59+
},
60+
{
61+
"id": "clip",
62+
"type": "clip",
63+
"source": "polygon",
64+
"layout": {
65+
"clip-layer-types": ["symbol"],
66+
"visibility": "none"
67+
}
68+
}
69+
]
70+
}
4.37 KB
Loading
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
{
2+
"version": 8,
3+
"metadata": {
4+
"test": {
5+
"height": 128,
6+
"width": 128
7+
}
8+
},
9+
"zoom": 4.2,
10+
"imports": [
11+
{
12+
"id": "basemap",
13+
"data": {
14+
"version": 8,
15+
"imports": [
16+
{
17+
"id": "basemap",
18+
"data": {
19+
"version": 8,
20+
"sprite": "local://sprites/sprite",
21+
"sources": {
22+
"points": {
23+
"type": "geojson",
24+
"data": {
25+
"type": "GeometryCollection",
26+
"geometries": [
27+
{
28+
"type": "Point",
29+
"coordinates": [2, -2]
30+
},
31+
{
32+
"type": "Point",
33+
"coordinates": [1, -1]
34+
},
35+
{
36+
"type": "Point",
37+
"coordinates": [-1, 1]
38+
},
39+
{
40+
"type": "Point",
41+
"coordinates": [-2, 2]
42+
}
43+
]
44+
}
45+
}
46+
},
47+
"layers": [
48+
{
49+
"id": "background",
50+
"type": "background",
51+
"paint": {
52+
"background-color": "white"
53+
}
54+
},
55+
{
56+
"id": "symbol",
57+
"type": "symbol",
58+
"source": "points",
59+
"layout": {
60+
"icon-image": "building-12",
61+
"icon-padding": 0
62+
}
63+
}
64+
]
65+
}
66+
}
67+
],
68+
"sprite": "local://sprites/sprite",
69+
"sources": {
70+
"clip": {
71+
"type": "geojson",
72+
"data": {
73+
"type": "Polygon",
74+
"coordinates": [[[-1.5, -1.5], [-1.5, 1.5], [1.5, 1.5], [1.5, -1.5], [-1.5, -1.5]]]
75+
}
76+
},
77+
"points": {
78+
"type": "geojson",
79+
"data": {
80+
"type": "GeometryCollection",
81+
"geometries": [
82+
{
83+
"type": "Point",
84+
"coordinates": [-1, -1]
85+
},
86+
{
87+
"type": "Point",
88+
"coordinates": [0, 0]
89+
},
90+
{
91+
"type": "Point",
92+
"coordinates": [1, 1]
93+
}
94+
]
95+
}
96+
}
97+
},
98+
"layers": [
99+
{
100+
"id": "symbol",
101+
"type": "symbol",
102+
"source": "points",
103+
"layout": {
104+
"icon-image": "rocket-12",
105+
"icon-padding": 0
106+
}
107+
},
108+
{
109+
"id": "clip-fill",
110+
"type": "fill",
111+
"source": "clip",
112+
"paint": {
113+
"fill-color": "rgba(0, 255, 0, 0.1)"
114+
}
115+
},
116+
{
117+
"id": "clip",
118+
"type": "clip",
119+
"source": "clip",
120+
"layout": {
121+
"clip-layer-types": ["symbol"],
122+
"_comment": "This layer should remove inner two images from immediately imported style, but not images from this style",
123+
"clip-layer-scope": ["basemap"]
124+
}
125+
}
126+
]
127+
}
128+
}
129+
],
130+
"sources": {
131+
"clip": {
132+
"type": "geojson",
133+
"data": {
134+
"type": "Polygon",
135+
"coordinates": [[[-0.5, -0.5], [-0.5, 0.5], [0.5, 0.5], [0.5, -0.5], [-0.5, -0.5]]]
136+
}
137+
},
138+
"clip2": {
139+
"type": "geojson",
140+
"data": {
141+
"type": "Polygon",
142+
"coordinates": [[[1.5, -1.5], [1.5, -2.5], [2.5, -2.5], [2.5, -1.5], [1.5, -1.5]]]
143+
}
144+
}
145+
},
146+
"layers": [
147+
{
148+
"id": "clip-fill",
149+
"type": "fill",
150+
"source": "clip",
151+
"paint": {
152+
"fill-color": "rgba(0, 0, 255, 0.1)"
153+
}
154+
},
155+
{
156+
"id": "clip-fill2",
157+
"type": "fill",
158+
"source": "clip2",
159+
"paint": {
160+
"fill-color": "rgba(255, 0, 0, 0.1)"
161+
}
162+
},
163+
{
164+
"id": "clip",
165+
"type": "clip",
166+
"source": "clip",
167+
"layout": {
168+
"clip-layer-types": ["symbol"],
169+
"_comment": "This layer should remove the center image from immediately imported style",
170+
"clip-layer-scope": ["basemap"]
171+
}
172+
},
173+
{
174+
"id": "clip2",
175+
"type": "clip",
176+
"source": "clip2",
177+
"layout": {
178+
"clip-layer-types": ["symbol"],
179+
"_comment": "This layer should remove the bottom right image from the most nested style, because if we want to remove something from an import, we should remove from its imports too",
180+
"clip-layer-scope": ["basemap"]
181+
}
182+
}
183+
]
184+
}
2.13 KB
Loading
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"version": 8,
3+
"metadata": {
4+
"test": {
5+
"height": 128,
6+
"width": 128
7+
}
8+
},
9+
"zoom": 1.5,
10+
"sprite": "local://sprites/sprite",
11+
"sources": {
12+
"points": {
13+
"type": "geojson",
14+
"data": {
15+
"type": "GeometryCollection",
16+
"geometries": [
17+
{
18+
"type": "Point",
19+
"coordinates": [0, 0]
20+
},
21+
{
22+
"type": "Point",
23+
"coordinates": [10, 10]
24+
}
25+
]
26+
}
27+
},
28+
"polygon": {
29+
"type": "geojson",
30+
"data": {
31+
"type": "Polygon",
32+
"coordinates": [[[-5, -5], [-5, 5], [5, 5], [5, -5], [-5, -5]]]
33+
}
34+
}
35+
},
36+
"layers": [
37+
{
38+
"id": "background",
39+
"type": "background",
40+
"paint": {
41+
"background-color": "white"
42+
}
43+
},
44+
{
45+
"id": "polygon",
46+
"type": "fill",
47+
"source": "polygon",
48+
"paint": {
49+
"fill-color": "rgba(0, 0, 255, 0.1)"
50+
}
51+
},
52+
{
53+
"id": "symbol",
54+
"type": "symbol",
55+
"source": "points",
56+
"layout": {
57+
"icon-image": "rocket-12"
58+
}
59+
},
60+
{
61+
"id": "clip",
62+
"type": "clip",
63+
"source": "polygon",
64+
"layout": {
65+
"clip-layer-types": ["symbol"]
66+
}
67+
}
68+
]
69+
}
9.59 KB
Loading

0 commit comments

Comments
 (0)