Skip to content

Commit 0284b22

Browse files
authored
Update utils.test.js
1 parent aefdd5e commit 0284b22

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/utils.test.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ rightTriangle.moveTo(1, 1);
5252
rightTriangle.lineTo(1, -1);
5353
rightTriangle.lineTo(-1, 1);
5454

55+
const rightTriangle2 = new Shape();
56+
rightTriangle2.moveTo(1, 1);
57+
rightTriangle2.lineTo(-1, 1);
58+
rightTriangle2.lineTo(1, -1);
59+
5560
test('Extents no Rotation', () => {
5661
expect(BuildingShapeUtils.extents(rightTriangle)).toStrictEqual([-1, -1, 1, 1]);
5762
});
@@ -67,7 +72,11 @@ test('Edge Lengths', () => {
6772
});
6873

6974
test('Edge Direction', () => {
70-
expect(BuildingShapeUtils.edgeDirection(rightTriangle)).toBeDeepCloseTo([-Math.PI / 2, -Math.PI / 4, 0]);
75+
expect(BuildingShapeUtils.edgeDirection(rightTriangle)).toBeDeepCloseTo([-Math.PI / 2, Math.PI / 4, 0]);
76+
});
77+
78+
test('Edge Direction', () => {
79+
expect(BuildingShapeUtils.edgeDirection(rightTriangle2)).toBeDeepCloseTo([Math.PI, -Math.PI / 4, Math.PI / 2]);
7180
});
7281

7382
test('Longest side angle', () => {
@@ -101,10 +110,6 @@ test('Vertex Angles', () => {
101110
expect(BuildingShapeUtils.vertexAngle(rightTriangle)).toStrictEqual([Math.PI / 2, Math.PI / 4, Math.PI / 4]);
102111
});
103112

104-
const rightTriangle2 = new Shape();
105-
rightTriangle2.moveTo(1, 1);
106-
rightTriangle2.lineTo(-1, 1);
107-
rightTriangle2.lineTo(1, -1);
108113
test('Vertex Angles counterclockwise', () => {
109114
expect(BuildingShapeUtils.vertexAngle(rightTriangle2)).toStrictEqual([-Math.PI / 2, -Math.PI / 4, -Math.PI / 4]);
110115
});

0 commit comments

Comments
 (0)