Skip to content

🎥 Make videos programmatically with React

test(studio): remove negative frame regression changes

Jonny Burger79b3159119f5
diff --git a/packages/example/e2e/studio.test.mts b/packages/example/e2e/studio.test.mts
index b5a6ff4c6f..509d340418 100644
--- a/packages/example/e2e/studio.test.mts
+++ b/packages/example/e2e/studio.test.mts
@@ -420,88 +420,26 @@ test.describe('visual mode', () => {
const negativeSequence = page.locator(
'[data-timeline-marquee-item][title="Negative start"]',
);
- const negativeSequenceWithoutFreeze = page.locator(
- '[data-timeline-marquee-item][title="Negative start without freeze"]',
- );
const zeroSequence = page.locator(
'[data-timeline-marquee-item][title="Zero start"]',
);
await expect(negativeSequence).toBeVisible();
- await expect(negativeSequenceWithoutFreeze).toBeVisible();
await expect(zeroSequence).toBeVisible();
- const negativeSequenceFrame = negativeSequence.locator(
- '[data-timeline-sequence-frame]',
- );
- const negativeSequenceFrameWithoutFreeze =
- negativeSequenceWithoutFreeze.locator('[data-timeline-sequence-frame]');
- await expect(negativeSequenceFrame).toContainText('20');
- await expect(negativeSequenceFrame.locator('svg')).toHaveCount(1);
- await expect(negativeSequenceFrameWithoutFreeze).toContainText('20');
- await expect(negativeSequenceFrameWithoutFreeze.locator('svg')).toHaveCount(
- 0,
- );
- const sequenceFrameIsClipped = (sequence: Locator) =>
- sequence.evaluate((element) => {
- const frame = element.querySelector('[data-timeline-sequence-frame]');
- if (!frame) {
- return true;
- }
- const frameRight = frame.getBoundingClientRect().right;
- let ancestor = frame.parentElement;
- while (ancestor && ancestor !== element) {
- const overflow = getComputedStyle(ancestor).overflow;
- if (
- (overflow === 'hidden' || overflow === 'clip') &&
- ancestor.getBoundingClientRect().right < frameRight
- ) {
- return true;
- }
-
- ancestor = ancestor.parentElement;
- }
-
- return false;
- });
-
- const [
- timelineRect,
- negativeSequenceRect,
- negativeSequenceFrameRect,
- zeroSequenceRect,
- ] = await Promise.all([
- timelineScrollable.boundingBox(),
- negativeSequence.boundingBox(),
- negativeSequenceFrame.boundingBox(),
- zeroSequence.boundingBox(),
- ]);
+ const [timelineRect, negativeSequenceRect, zeroSequenceRect] =
+ await Promise.all([
+ timelineScrollable.boundingBox(),
+ negativeSequence.boundingBox(),
+ zeroSequence.boundingBox(),
+ ]);
expect(timelineRect).not.toBeNull();
expect(negativeSequenceRect).not.toBeNull();
- expect(negativeSequenceFrameRect).not.toBeNull();
expect(zeroSequenceRect).not.toBeNull();
expect(negativeSequenceRect!.x).toBeGreaterThanOrEqual(timelineRect!.x);
expect(negativeSequenceRect!.x).toBeLessThan(zeroSequenceRect!.x);
expect(zeroSequenceRect!.x - negativeSequenceRect!.x).toBeLessThanOrEqual(
16,
);
- expect(
- negativeSequenceFrameRect!.x + negativeSequenceFrameRect!.width,
- ).toBeGreaterThan(negativeSequenceRect!.x + negativeSequenceRect!.width);
- expect(
- await negativeSequence.evaluate(
- (element) => getComputedStyle(element).overflow,
- ),
- ).toBe('visible');
- expect(await sequenceFrameIsClipped(negativeSequence)).toBe(true);
- expect(await sequenceFrameIsClipped(negativeSequenceWithoutFreeze)).toBe(
- true,
- );
-
- await page.getByRole('button', {name: 'Step forward one frame'}).click();
- await expect(negativeSequenceFrame).toContainText('20');
- await expect(negativeSequenceFrame.locator('svg')).toHaveCount(1);
- await expect(negativeSequenceFrameWithoutFreeze).toHaveCount(0);
- expect(await sequenceFrameIsClipped(negativeSequence)).toBe(true);
});
test('should commit a color drag before the picker closes', async ({