Skip to content

Commit bb7ef01

Browse files
authored
Update building.test.js
1 parent 66682b7 commit bb7ef01

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
@@ -378,6 +378,34 @@ test('Multipolygon Part must be within outline', () => {
378378
expect(new Building('11', data).parts.length).toBe(0);
379379
});
380380

381+
/** Test partIsInside
382+
class BldgMock extends Building {
383+
384+
constructor() {
385+
this.shape = new Shape();
386+
}
387+
}
388+
389+
class PartMock {
390+
constructor(shape) {
391+
this.shape = shape;
392+
}
393+
}
394+
395+
describe.each([
396+
[[], false, 'Two Separate Ways'],
397+
[[], true, 'Two Ways share edge'],
398+
[[], false, 'multipolygon outside'],
399+
])('partIsInside', (shapePoints, expected, description) => {
400+
test(`${description}`, () => {
401+
const shape = new Shape(shapePoints.map((point) => new Vector2(...point)));
402+
const part = new PartMock(shape);
403+
const bldg = new BldgMock();
404+
expect(bldg.partIsInside(part)).toBe(expected);
405+
});
406+
});
407+
*/
408+
381409
window.printError = printError;
382410

383411
var errors = [];

0 commit comments

Comments
 (0)