using DeepDrftPublic.Client.Helpers; namespace DeepDrftTests; /// /// Unit tests for the share-popover embed snippet (). The builder is /// the mode-aware half of SharePopover: track mode targets FramePlayer's TrackEntryKey param, release /// mode targets its ReleaseEntryKey param. The iframe chrome (dimensions, autoplay) must be identical /// across both. Pure string composition, tested directly without rendering the component. /// [TestFixture] public class EmbedSnippetBuilderTests { private const string BaseUri = "https://deepdrft.example/"; [Test] public void ForTrack_EmitsTrackEntryKeySrc() { var snippet = EmbedSnippetBuilder.ForTrack(BaseUri, "abc123"); Assert.That(snippet, Does.Contain(@"src=""https://deepdrft.example/FramePlayer?TrackEntryKey=abc123""")); Assert.That(snippet, Does.Not.Contain("ReleaseEntryKey")); } [Test] public void ForRelease_EmitsReleaseEntryKeySrc() { var snippet = EmbedSnippetBuilder.ForRelease(BaseUri, "rel-xyz"); Assert.That(snippet, Does.Contain(@"src=""https://deepdrft.example/FramePlayer?ReleaseEntryKey=rel-xyz""")); Assert.That(snippet, Does.Not.Contain("TrackEntryKey")); } [Test] public void BothModes_ShareIdenticalIframeChrome() { var track = EmbedSnippetBuilder.ForTrack(BaseUri, "k"); var release = EmbedSnippetBuilder.ForRelease(BaseUri, "k"); Assert.Multiple(() => { foreach (var snippet in new[] { track, release }) { Assert.That(snippet, Does.StartWith("")); } }); } }