Clean up tests

This commit is contained in:
Tyrrrz 2023-05-25 18:51:49 +03:00
parent 4eab781450
commit e7310274ba
2 changed files with 17 additions and 18 deletions

View file

@ -2,7 +2,6 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using AngleSharp.Dom; using AngleSharp.Dom;
using DiscordChatExporter.Cli.Tests.Infra; using DiscordChatExporter.Cli.Tests.Infra;
using DiscordChatExporter.Core.Discord;
using FluentAssertions; using FluentAssertions;
using Xunit; using Xunit;
@ -39,21 +38,4 @@ public class HtmlContentSpecs
"Yeet" "Yeet"
); );
} }
[Fact]
public async Task Messages_cross_posted_from_other_guilds_are_rendered_with_the_server_tag()
{
// https://github.com/Tyrrrz/DiscordChatExporter/issues/633
// Act
var message = await ExportWrapper.GetMessageAsHtmlAsync(
ChannelIds.ReplyTestCases,
Snowflake.Parse("1072165330853576876")
);
// Assert
message.Text().Should().Contain("This is a test message from an announcement channel on another server");
message.Text().Should().Contain("SERVER");
message.QuerySelector(".chatlog__reply-link").Should().BeNull();
}
} }

View file

@ -71,4 +71,21 @@ public class HtmlReplySpecs
// Assert // Assert
message.Text().Should().Contain("used /poll"); message.Text().Should().Contain("used /poll");
} }
[Fact]
public async Task I_can_export_a_channel_that_contains_a_message_cross_posted_from_another_guild()
{
// https://github.com/Tyrrrz/DiscordChatExporter/issues/633
// Act
var message = await ExportWrapper.GetMessageAsHtmlAsync(
ChannelIds.ReplyTestCases,
Snowflake.Parse("1072165330853576876")
);
// Assert
message.Text().Should().Contain("This is a test message from an announcement channel on another server");
message.Text().Should().Contain("SERVER");
message.QuerySelector(".chatlog__reply-link").Should().BeNull();
}
} }