Files
piik/tests/watch-embed-preview.test.ts
T
AAA 52cf6270e1 fix(watch): preview sources and resume stalled viewers
Show unassociated webpage resources in the existing source dialog before
publishing the same prepared media. Keep preview cancellation and promotion
with the source-selection owner, including canonical embedded-player URLs.

Rejoin the shared position when a viewer resumes after buffering. Retire the
issued seek on playback progress so a later independent stall can recover.

Verified the source dialog, media handoff and cancellation in Chrome, both
TypeScript projects, documentation, and the full 2654-test Web suite.
2026-11-28 22:07:42 -05:00

17 lines
850 B
TypeScript

import { createElement } from "react";
import { renderToStaticMarkup } from "react-dom/server";
import { expect, test } from "vitest";
import { useChannelGuideSample } from "../src/client/pages/ChannelGuidePreview";
import { WatchSourceDialog } from "../src/client/channel/components/ChannelShareControl";
test("the guide sample owns the embedded-source methods used when opening the watch dialog", () => {
function SampleDialog() {
const { channel } = useChannelGuideSample();
expect(channel.watchPreview("friday")).toBeUndefined();
expect(channel.prepareWatchEmbed).toBeTypeOf("function");
expect(channel.confirmWatchPreview).toBeTypeOf("function");
return createElement(WatchSourceDialog, { channel, roomId: "friday", onClose() {} });
}
expect(() => renderToStaticMarkup(createElement(SampleDialog))).not.toThrow();
});