Skip to content

Commit 264fd06

Browse files
authored
Update combine_ways.js
1 parent 02372a8 commit 264fd06

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/combine_ways.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,17 @@ import { Shape } from 'three';
1313
import { BuildingShapeUtils } from '../src/extras/BuildingShapeUtils.js';
1414
// import { JSDOM } from 'jsdom';
1515

16+
test('Test no combining necessary. one closed way', () => {
17+
var way1 = '<way id="1"><nd ref="1"/><nd ref="2"/><nd ref="3"/><nd ref="4"/><nd ref="1"/></way>';
18+
var way3 = '<way id="1"><nd ref="1"/><nd ref="2"/><nd ref="3"/><nd ref="4"/><nd ref="1"/></way>';
19+
let parser = new window.DOMParser();
20+
let xml1 = parser.parseFromString(way1, 'text/xml').getElementsByTagName('way')[0];
21+
let result = BuildingShapeUtils.combineWays([xml1]);
22+
expect(result.length).toBe(1);
23+
let expected = parser.parseFromString(way3, 'text/xml');
24+
expect(result[0].outerHTML).toBe(way3);
25+
});
26+
1627
test('Test combining 2 ways 1->2', () => {
1728
var way1 = '<way id="1"><nd ref="1"/><nd ref="2"/><nd ref="3"/></way>';
1829
var way2 = '<way id="2"><nd ref="3"/><nd ref="4"/><nd ref="1"/></way>';

0 commit comments

Comments
 (0)