mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-27 13:14:17 -04:00
Add tests for gifv embeds
This commit is contained in:
parent
da87f3c774
commit
f376028d76
1 changed files with 32 additions and 1 deletions
|
@ -55,7 +55,7 @@ public class EmbedSpecs : IClassFixture<ExportWrapperFixture>
|
|||
.QuerySelectorAll("img")
|
||||
.Select(e => e.GetAttribute("src"))
|
||||
.Should()
|
||||
.Contain("https://i.redd.it/f8w05ja8s4e61.png");
|
||||
.EndWith("i.redd.it/f8w05ja8s4e61.png");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -74,6 +74,37 @@ public class EmbedSpecs : IClassFixture<ExportWrapperFixture>
|
|||
content.Should().BeNullOrEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Message_containing_a_gifv_link_is_rendered_with_a_video_embed()
|
||||
{
|
||||
// Act
|
||||
var message = await _exportWrapper.GetMessageAsHtmlAsync(
|
||||
ChannelIds.EmbedTestCases,
|
||||
Snowflake.Parse("1019234520349814794")
|
||||
);
|
||||
|
||||
// Assert
|
||||
message
|
||||
.QuerySelectorAll("source")
|
||||
.Select(e => e.GetAttribute("src"))
|
||||
.Should()
|
||||
.EndWith("media.tenor.com/DDAJeW6BQKkAAAPo/tooncasm-test-copy.mp4");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Message_containing_a_gifv_link_and_nothing_else_is_rendered_without_text_content()
|
||||
{
|
||||
// Act
|
||||
var message = await _exportWrapper.GetMessageAsHtmlAsync(
|
||||
ChannelIds.EmbedTestCases,
|
||||
Snowflake.Parse("1019234520349814794")
|
||||
);
|
||||
|
||||
// Assert
|
||||
var content = message.QuerySelector(".chatlog__content")?.Text();
|
||||
content.Should().BeNullOrEmpty();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Message_containing_a_Spotify_track_link_is_rendered_with_a_track_embed()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue