Simplify YouTube embed test to focus on data not structure

- Remove checks for HTML structure (class names, nested elements)
- Focus on verifying YouTube URL with correct video ID exists
- Follow same pattern as other embed tests (Spotify, Twitch)

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-12 11:21:57 +00:00
parent b9865dce8c
commit 58504e2b8d

View file

@ -181,24 +181,15 @@ public class HtmlEmbedSpecs
); );
// Assert // Assert
var youtubeLink = message var youtubeUrl = message
.QuerySelectorAll("a") .QuerySelectorAll("a")
.FirstOrDefault(e => .Select(e => e.GetAttribute("href"))
e.GetAttribute("href")?.Contains("youtube.com/watch?v=", StringComparison.Ordinal) .WhereNotNull()
== true .FirstOrDefault(s =>
s.Contains("youtube.com/watch?v=qOWW4OlgbvE", StringComparison.Ordinal)
); );
youtubeLink.Should().NotBeNull(); youtubeUrl.Should().NotBeNull();
youtubeLink?.GetAttribute("href").Should().Contain("qOWW4OlgbvE");
// Check that the thumbnail image exists
var thumbnail = youtubeLink
?.QuerySelectorAll("img")
.FirstOrDefault(e =>
e.GetAttribute("class")?.Contains("chatlog__embed-youtube-thumbnail") == true
);
thumbnail.Should().NotBeNull();
} }
[Fact] [Fact]