Skip to content

Commit 6e21301

Browse files
committed
Tests requests DataTables: fix features type
1 parent d3724bd commit 6e21301

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

tests/end2end/playwright/requests-datatables.spec.js

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ test.describe('Datables Requests @requests @readonly', () => {
3434
expect(body.data).toHaveProperty('type', 'FeatureCollection');
3535
expect(body.data).toHaveProperty('features');
3636
expect(body.data.features).toHaveLength(7);
37-
expect(body.data.features.map(feat => feat.properties.quartier)).toEqual(
37+
/** @type {any[]} */
38+
const features = body.data.features;
39+
expect(features.map(feat => feat.properties.quartier)).toEqual(
3840
[1,2,3,4,5,6,7]
3941
);
4042
// Check editable features
@@ -76,7 +78,9 @@ test.describe('Datables Requests @requests @readonly', () => {
7678
expect(body.data).toHaveProperty('type', 'FeatureCollection');
7779
expect(body.data).toHaveProperty('features');
7880
expect(body.data.features).toHaveLength(5);
79-
expect(body.data.features.map(feat => feat.properties.quartier)).toEqual(
81+
/** @type {any[]} */
82+
const features = body.data.features;
83+
expect(features.map(feat => feat.properties.quartier)).toEqual(
8084
[1,2,3,6,7]
8185
);
8286
});
@@ -111,7 +115,9 @@ test.describe('Datables Requests @requests @readonly', () => {
111115
expect(body.data).toHaveProperty('type', 'FeatureCollection');
112116
expect(body.data).toHaveProperty('features');
113117
expect(body.data.features).toHaveLength(7);
114-
expect(body.data.features.map(feat => feat.properties.quartier)).toEqual(
118+
/** @type {any[]} */
119+
const features = body.data.features;
120+
expect(features.map(feat => feat.properties.quartier)).toEqual(
115121
[1,2,3,4,5,6,7].reverse()
116122
);
117123
});
@@ -153,10 +159,12 @@ test.describe('Datables Requests @requests @readonly', () => {
153159
expect(body.data).toHaveProperty('type', 'FeatureCollection');
154160
expect(body.data).toHaveProperty('features');
155161
expect(body.data.features).toHaveLength(1);
156-
expect(body.data.features.map(feat => feat.properties.quartier)).toEqual(
162+
/** @type {any[]} */
163+
let features = body.data.features;
164+
expect(features.map(feat => feat.properties.quartier)).toEqual(
157165
[4]
158166
);
159-
expect(body.data.features.map(feat => feat.properties.quartmno)).toEqual(
167+
expect(features.map(feat => feat.properties.quartmno)).toEqual(
160168
['CX']
161169
);
162170

@@ -189,10 +197,12 @@ test.describe('Datables Requests @requests @readonly', () => {
189197
expect(body.data).toHaveProperty('type', 'FeatureCollection');
190198
expect(body.data).toHaveProperty('features');
191199
expect(body.data.features).toHaveLength(2);
192-
expect(body.data.features.map(feat => feat.properties.quartier)).toEqual(
200+
/** @type {any[]} */
201+
features = body.data.features;
202+
expect(features.map(feat => feat.properties.quartier)).toEqual(
193203
[3,4]
194204
);
195-
expect(body.data.features.map(feat => feat.properties.quartmno)).toEqual(
205+
expect(features.map(feat => feat.properties.quartmno)).toEqual(
196206
['CV','CX']
197207
);
198208

@@ -226,10 +236,12 @@ test.describe('Datables Requests @requests @readonly', () => {
226236
expect(body.data).toHaveProperty('type', 'FeatureCollection');
227237
expect(body.data).toHaveProperty('features');
228238
expect(body.data.features).toHaveLength(4);
229-
expect(body.data.features.map(feat => feat.properties.quartier)).toEqual(
239+
/** @type {any[]} */
240+
features = body.data.features;
241+
expect(features.map(feat => feat.properties.quartier)).toEqual(
230242
[2,3,4,5]
231243
);
232-
expect(body.data.features.map(feat => feat.properties.quartmno)).toEqual(
244+
expect(features.map(feat => feat.properties.quartmno)).toEqual(
233245
['PA','CV','CX','PR']
234246
);
235247
});
@@ -356,7 +368,9 @@ test.describe('Datables Requests @requests @readonly', () => {
356368
expect(body.data).toHaveProperty('type', 'FeatureCollection');
357369
expect(body.data).toHaveProperty('features');
358370
expect(body.data.features).toHaveLength(2);
359-
expect(body.data.features.map(feat => feat.properties.quartier)).toEqual(
371+
/** @type {any[]} */
372+
let features = body.data.features;
373+
expect(features.map(feat => feat.properties.quartier)).toEqual(
360374
[2,3]
361375
);
362376
});

0 commit comments

Comments
 (0)