Skip to content

🎥 Make videos programmatically with React

update tests

Jonny Burger0bc5df9f7017
diff --git a/packages/shapes/src/test/circle.test.tsx b/packages/shapes/src/test/circle.test.tsx
index 7fce602300..edc75cdb1a 100644
--- a/packages/shapes/src/test/circle.test.tsx
+++ b/packages/shapes/src/test/circle.test.tsx
@@ -8,6 +8,6 @@ test('Should be able to make a circle svg', () => {
);
expect(container.querySelector('path')?.getAttribute('d')).toEqual(
- 'M 100 100 m -100 0 a 100 100 0 1 0 200 0 100 100 0 1 0 -200 0'
+ 'M 100 100 m -100 0 a 100 100 0 1 0 200 0 a 100 100 0 1 0 -200 0'
);
});
diff --git a/packages/shapes/src/test/make-circle.test.ts b/packages/shapes/src/test/make-circle.test.ts
index 722d2467c1..c85f86ad36 100644
--- a/packages/shapes/src/test/make-circle.test.ts
+++ b/packages/shapes/src/test/make-circle.test.ts
@@ -6,7 +6,31 @@ test('Should be able to make a circle path', () => {
expect(circlePath).toEqual({
height: 100,
width: 100,
- path: 'M 50 50 m -50 0 a 50 50 0 1 0 100 0 50 50 0 1 0 -100 0',
+ path: 'M 50 50 m -50 0 a 50 50 0 1 0 100 0 a 50 50 0 1 0 -100 0',
transformOrigin: '50 50',
+ instructions: [
+ {type: 'M', x: 50, y: 50},
+ {type: 'm', x: -50, y: 0},
+ {
+ type: 'a',
+ rx: 50,
+ ry: 50,
+ xAxisRotation: 0,
+ largeArcFlag: true,
+ sweepFlag: false,
+ x: 100,
+ y: 0,
+ },
+ {
+ type: 'a',
+ rx: 50,
+ ry: 50,
+ xAxisRotation: 0,
+ largeArcFlag: true,
+ sweepFlag: false,
+ x: -100,
+ y: 0,
+ },
+ ],
});
});
diff --git a/packages/shapes/src/test/make-ellipse.test.ts b/packages/shapes/src/test/make-ellipse.test.ts
index f7e7de0903..155d756840 100644
--- a/packages/shapes/src/test/make-ellipse.test.ts
+++ b/packages/shapes/src/test/make-ellipse.test.ts
@@ -8,5 +8,18 @@ test('Should be able to make a circle path', () => {
height: 100,
width: 200,
transformOrigin: '100 50',
+ instructions: [
+ {type: 'M', x: 100, y: 0},
+ {
+ type: 'a',
+ rx: 100,
+ ry: 50,
+ xAxisRotation: 0,
+ largeArcFlag: true,
+ sweepFlag: false,
+ x: 1,
+ y: 0,
+ },
+ ],
});
});
diff --git a/packages/shapes/src/test/make-rect.test.ts b/packages/shapes/src/test/make-rect.test.ts
index 602481edb9..a109141976 100644
--- a/packages/shapes/src/test/make-rect.test.ts
+++ b/packages/shapes/src/test/make-rect.test.ts
@@ -6,7 +6,14 @@ test('Should be able to make a rect path', () => {
expect(rect).toEqual({
height: 100,
width: 100,
- path: 'M 0 0 l 100 0 l 0 100 l -100 0 Z',
+ path: 'M 0 0 L 100 0 L 100 100 L 0 100 L 0 0',
transformOrigin: '50 50',
+ instructions: [
+ {type: 'M', x: 0, y: 0},
+ {type: 'L', x: 100, y: 0},
+ {type: 'L', x: 100, y: 100},
+ {type: 'L', x: 0, y: 100},
+ {type: 'L', x: 0, y: 0},
+ ],
});
});
diff --git a/packages/shapes/src/test/make-triangle.test.ts b/packages/shapes/src/test/make-triangle.test.ts
index 5a735b14e8..618b6f146c 100644
--- a/packages/shapes/src/test/make-triangle.test.ts
+++ b/packages/shapes/src/test/make-triangle.test.ts
@@ -6,10 +6,17 @@ test('Should be able to make a triangle path', () => {
length: 100,
direction: 'right',
});
+
expect(rightTriangle).toEqual({
width: 86.60254037844386,
height: 100,
- path: 'M 0 0 L 0 100 L 86.60254037844386 50 z',
+ path: 'M 0 0 L 0 100 L 86.60254037844386 50 L 0 0',
transformOrigin: '28.867513459481287 50',
+ instructions: [
+ {type: 'M', x: 0, y: 0},
+ {type: 'L', x: 0, y: 100},
+ {type: 'L', x: 86.60254037844386, y: 50},
+ {type: 'L', x: 0, y: 0},
+ ],
});
});
diff --git a/packages/shapes/src/test/square.test.tsx b/packages/shapes/src/test/square.test.tsx
index e52955ae58..626278fc66 100644
--- a/packages/shapes/src/test/square.test.tsx
+++ b/packages/shapes/src/test/square.test.tsx
@@ -7,6 +7,6 @@ test('Should be able to make a rect svg', () => {
// assert path
expect(container.querySelector('path')?.getAttribute('d')).toEqual(
- 'M 0 0 l 200 0 l 0 200 l -200 0 Z'
+ 'M 0 0 L 200 0 L 200 200 L 0 200 L 0 0'
);
});
diff --git a/packages/shapes/src/test/triangle.test.tsx b/packages/shapes/src/test/triangle.test.tsx
index 74e7d07e0d..0937aa7f6a 100644
--- a/packages/shapes/src/test/triangle.test.tsx
+++ b/packages/shapes/src/test/triangle.test.tsx
@@ -9,6 +9,6 @@ test('Should be able to make a triangle svg', () => {
// assert path
expect(container.querySelector('path')?.getAttribute('d')).toEqual(
- 'M 86.60254037844386 0 L 86.60254037844386 100 L 0 50 z'
+ 'M 86.60254037844386 0 L 86.60254037844386 100 L 0 50 L 86.60254037844386 0'
);
});