mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-01 15:49:11 +00:00
Cleanup tests
This commit is contained in:
@@ -3,7 +3,6 @@ using System.Threading.Tasks;
|
||||
using AngleSharp.Dom;
|
||||
using DiscordChatExporter.Cli.Tests.Fixtures;
|
||||
using DiscordChatExporter.Cli.Tests.TestData;
|
||||
using DiscordChatExporter.Core.Discord;
|
||||
using FluentAssertions;
|
||||
using Xunit;
|
||||
|
||||
@@ -47,18 +46,4 @@ public class ContentSpecs : IClassFixture<ExportWrapperFixture>
|
||||
"Yeet"
|
||||
);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Message_content_is_hidden_if_it_only_contains_a_link_to_an_image()
|
||||
{
|
||||
// Act
|
||||
var message = await _exportWrapper.GetMessageAsHtmlAsync(
|
||||
ChannelIds.EmbedTestCases,
|
||||
Snowflake.Parse("991768701126852638")
|
||||
);
|
||||
|
||||
// Assert
|
||||
var content = message.QuerySelector(".chatlog__content")?.Text();
|
||||
content.Should().BeNullOrEmpty();
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class EmbedSpecs : IClassFixture<ExportWrapperFixture>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Message_with_a_link_to_an_image_contains_an_embed_of_that_image()
|
||||
public async Task Message_containing_an_image_link_is_rendered_with_an_image_embed()
|
||||
{
|
||||
// Act
|
||||
var message = await _exportWrapper.GetMessageAsHtmlAsync(
|
||||
@@ -57,7 +57,21 @@ public class EmbedSpecs : IClassFixture<ExportWrapperFixture>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Message_with_a_Spotify_track_is_rendered_using_an_iframe()
|
||||
public async Task Message_containing_an_image_link_and_nothing_else_is_rendered_without_text_content()
|
||||
{
|
||||
// Act
|
||||
var message = await _exportWrapper.GetMessageAsHtmlAsync(
|
||||
ChannelIds.EmbedTestCases,
|
||||
Snowflake.Parse("991768701126852638")
|
||||
);
|
||||
|
||||
// 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()
|
||||
{
|
||||
// Act
|
||||
var message = await _exportWrapper.GetMessageAsHtmlAsync(
|
||||
@@ -71,7 +85,7 @@ public class EmbedSpecs : IClassFixture<ExportWrapperFixture>
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Message_with_a_YouTube_video_is_rendered_using_an_iframe()
|
||||
public async Task Message_containing_a_YouTube_video_link_is_rendered_with_a_video_embed()
|
||||
{
|
||||
// Act
|
||||
var message = await _exportWrapper.GetMessageAsHtmlAsync(
|
||||
|
||||
@@ -40,7 +40,7 @@ public class StickerSpecs : IClassFixture<ExportWrapperFixture>
|
||||
);
|
||||
|
||||
// Assert
|
||||
var stickerUrl = message.QuerySelector("[title='Yikes'] div[data-source]")?.GetAttribute("data-source");
|
||||
var stickerUrl = message.QuerySelector("[title='Yikes'] [data-source]")?.GetAttribute("data-source");
|
||||
stickerUrl.Should().Be("https://discord.com/stickers/816087132447178774.json");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user