Skip to content

🎥 Make videos programmatically with React

Update freeze.test.tsx

Jonny Burgercb8e1547b577
diff --git a/packages/core/src/test/freeze.test.tsx b/packages/core/src/test/freeze.test.tsx
index de7ef50e84..82c8267092 100644
--- a/packages/core/src/test/freeze.test.tsx
+++ b/packages/core/src/test/freeze.test.tsx
@@ -4,7 +4,6 @@
import {render} from '@testing-library/react';
import React from 'react';
import {describe, expect, test} from 'vitest';
-import {CanUseRemotionHooksProvider} from '../CanUseRemotionHooks.js';
import {Freeze} from '../freeze.js';
import {Sequence} from '../Sequence.js';
import type {TimelineContextValue} from '../timeline-position-state.js';
@@ -16,15 +15,27 @@ import {WrapSequenceContext} from './wrap-sequence-context.js';
describe('Prop validation', () => {
test('It should throw if Freeze has string as frame prop value', () => {
expectToThrow(
- // @ts-expect-error
- () => render(<Freeze frame={'0'} />),
+ () =>
+ render(
+ <WrapSequenceContext>
+ {/**
+ // @ts-expect-error */}
+ <Freeze frame={'0'} />
+ </WrapSequenceContext>
+ ),
/The 'frame' prop of <Freeze \/> must be a number, but is of type string/
);
});
test('It should throw if Freeze has undefined as frame prop value', () => {
expectToThrow(
- // @ts-expect-error
- () => render(<Freeze />),
+ () =>
+ render(
+ <WrapSequenceContext>
+ {/**
+ // @ts-expect-error */}
+ <Freeze />
+ </WrapSequenceContext>
+ ),
/The <Freeze \/> component requires a 'frame' prop, but none was passed./
);
});
@@ -48,11 +59,11 @@ const timelineCtxValue = (frame: number): TimelineContextValue => ({
const renderForFrame = (frame: number, markup: React.ReactNode) => {
return render(
- <CanUseRemotionHooksProvider>
+ <WrapSequenceContext>
<TimelineContext.Provider value={timelineCtxValue(frame)}>
{markup}
</TimelineContext.Provider>
- </CanUseRemotionHooksProvider>
+ </WrapSequenceContext>
);
};