comparison client/tests/unit/geo/geo.spec.js @ 696:1db1ae344087

refac: test adjusted. testdata as JSON string
author Thomas Junk <thomas.junk@intevation.de>
date Thu, 20 Sep 2018 15:54:34 +0200
parents 87ea9d267c2b
children 0c5cbbafbd94
comparison
equal deleted inserted replaced
693:a1c62adc9bcb 696:1db1ae344087
1 import { prepareProfile } from "../../../src/application/lib/geo"; 1 import { prepareProfile } from "../../../src/application/lib/geo";
2 2
3 const geoJSON = { 3 const geoJSON = JSON.parse(`{
4 type: "Feature", 4 "type": "Feature",
5 geometry: { 5 "geometry": {
6 type: "MultiLineString", 6 "type": "MultiLineString",
7 coordinates: [ 7 "coordinates": [
8 [ 8 [
9 [17.216391563415527, 48.0245195664277, 123], 9 [17.216391563415527, 48.0245195664277, 123],
10 [17.216777801513672, 48.024720482272315, 124] 10 [17.216777801513672, 48.024720482272315, 124]
11 ], 11 ],
12 [ 12 [
13 [17.218494415283203, 48.02540933065123, 125], 13 [17.218494415283203, 48.02540933065123, 125],
14 [17.219438552856445, 48.02586855778941, 126], 14 [17.219438552856445, 48.02586855778941, 126],
15 [17.220726013183594, 48.02647128719908, 127], 15 [17.220726013183594, 48.02647128719908, 127],
16 [17.221627235412598, 48.026987906797494, 128], 16 [17.221627235412598, 48.026987906797494, 128],
17 [17.222957611083984, 48.02759062311748, 129], 17 [17.222957611083984, 48.02759062311748, 129],
18 [17.223901748657227, 48.0280785311666, 130], 18 [17.223901748657227, 48.0280785311666, 130],
19 [17.224159240722656, 48.02819333238926, 131] 19 [17.224159240722656, 48.02819333238926, 131]
20 ], 20 ],
21 [ 21 [
22 [17.225961685180664, 48.02891083423718, 132], 22 [17.225961685180664, 48.02891083423718, 132],
23 [17.227892875671383, 48.02997271864036, 133] 23 [17.227892875671383, 48.02997271864036, 133]
24 ] 24 ]
25 ] 25 ]
26 }, 26 },
27 properties: {} 27 "properties": {}
28 }; 28 }`);
29 29
30 test("prepare diagram", () => { 30 test("prepare diagram", () => {
31 const coordinates = geoJSON.geometry.coordinates; 31 const coordinates = geoJSON.geometry.coordinates;
32 const firstSegment = coordinates[0]; 32 const firstSegment = coordinates[0];
33 const lastSegment = coordinates[coordinates.length - 1]; 33 const lastSegment = coordinates[coordinates.length - 1];