diff --git a/DiscordChatExporter.Cli.Tests/Specs/HtmlEmbedSpecs.cs b/DiscordChatExporter.Cli.Tests/Specs/HtmlEmbedSpecs.cs index 0a406a4b..a959d462 100644 --- a/DiscordChatExporter.Cli.Tests/Specs/HtmlEmbedSpecs.cs +++ b/DiscordChatExporter.Cli.Tests/Specs/HtmlEmbedSpecs.cs @@ -181,15 +181,14 @@ public class HtmlEmbedSpecs ); // Assert - var youtubeUrl = message - .QuerySelectorAll("a") - .Select(e => e.GetAttribute("href")) + // Check that the YouTube video thumbnail image exists with the correct video ID + var youtubeThumbnailSrc = message + .QuerySelectorAll("img") + .Select(e => e.GetAttribute("src")) .WhereNotNull() - .FirstOrDefault(s => - s.Contains("youtube.com/watch?v=qOWW4OlgbvE", StringComparison.Ordinal) - ); + .FirstOrDefault(s => s.Contains("qOWW4OlgbvE", StringComparison.Ordinal)); - youtubeUrl.Should().NotBeNull(); + youtubeThumbnailSrc.Should().NotBeNull(); } [Fact] diff --git a/DiscordChatExporter.Core/Exporting/MessageGroupTemplate.cshtml b/DiscordChatExporter.Core/Exporting/MessageGroupTemplate.cshtml index 4387a678..bfd3b6ba 100644 --- a/DiscordChatExporter.Core/Exporting/MessageGroupTemplate.cshtml +++ b/DiscordChatExporter.Core/Exporting/MessageGroupTemplate.cshtml @@ -427,7 +427,11 @@ @* Video thumbnail *@