Skip to content

Commit d688e40

Browse files
committed
test(studio): fade handles measure the clip only while they show
1 parent 48fb920 commit d688e40

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎packages/studio/src/player/components/TimelineClipFades.test.tsx‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,17 @@ describe("TimelineClipFades", () => {
129129
act(() => root.unmount());
130130
});
131131

132+
it("measures the clip only while its handles show, so a zoom step forces no layout", () => {
133+
const measure = vi.spyOn(window, "getComputedStyle");
134+
const { rerender } = render(clip, { showHandles: false });
135+
rerender({ ...clip, duration: 11 });
136+
expect(measure).not.toHaveBeenCalled();
137+
act(() => mounted[0]?.unmount());
138+
render(clip, { showHandles: true });
139+
expect(measure).toHaveBeenCalled();
140+
measure.mockRestore();
141+
});
142+
132143
it("renders nothing for a clip without fades when the handles are hidden", () => {
133144
const { host, root } = render(
134145
{ ...clip, fadeIn: undefined, fadeOut: undefined },

0 commit comments

Comments
 (0)