Skip to content

Commit 9bf516a

Browse files
authored
Update building.test.js
1 parent 55fddf1 commit 9bf516a

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/building.test.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,34 @@ test('Test downloading type=building with multipolygon outline and multiple inne
315315
expect(global.fetch.mock.calls[2][0]).toBe(urlBase + 'map?bbox=30.4980057,59.9380365,30.4993839,59.9385087');
316316
});
317317

318+
test('Part must be within outline', () => {
319+
const data = `<?xml version="1.0" encoding="UTF-8"?>
320+
<osm>
321+
<node id="1" lat="0.001" lon="0.001"/>
322+
<node id="2" lat="0.001" lon="0"/>
323+
<node id="3" lat="0" lon="0"/>
324+
<node id="4" lat="0" lon=".0005"/>
325+
<node id="5" lat="0" lon=".001"/>
326+
<node id="6" lat=".0001" lon=".001"/>
327+
<node id="7" lat=".0001" lon="0.005"/>
328+
<way id="1">
329+
<nd ref="1"/>
330+
<nd ref="2"/>
331+
<nd ref="3"/>
332+
<tag k="building" v="apartments"/>
333+
</way>
334+
<way id="2">
335+
<nd ref="4"/>
336+
<nd ref="5"/>
337+
<nd ref="6"/>
338+
<nd ref="7"/>
339+
<tag k="building:part" v="yes"/>
340+
</way>
341+
</osm>
342+
`;
343+
expect(new Building('1', data).parts.length).toBe(0);
344+
});
345+
318346
window.printError = printError;
319347

320348
var errors = [];

0 commit comments

Comments
 (0)