Fix tests harder this time

This commit is contained in:
Tyrrrz
2026-02-27 18:59:52 +02:00
parent 98e294f7e4
commit 03dd272eaf
3 changed files with 16 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
using System.Threading.Tasks;
using AngleSharp.Dom;
using DiscordChatExporter.Cli.Tests.Infra;
using DiscordChatExporter.Cli.Tests.Utils.Extensions;
using DiscordChatExporter.Core.Discord;
using FluentAssertions;
using Xunit;
@@ -19,6 +20,10 @@ public class HtmlForwardSpecs
);
// Assert
message.Text().Should().ContainAll("Forwarded", @"¯\_(ツ)_/¯", "December 29, 2025");
message
.Text()
.ReplaceWhiteSpace()
.Should()
.ContainAll("Forwarded", @"¯\_(ツ)_/¯", "12/29/2025 2:14 PM");
}
}

View File

@@ -24,6 +24,10 @@ public class JsonForwardSpecs
var forwardedMessage = message.GetProperty("forwardedMessage");
forwardedMessage.GetProperty("content").GetString().Should().Contain(@"¯\_(ツ)_/¯");
forwardedMessage.GetProperty("timestamp").GetString().Should().StartWith("2025-12-28T22:52:42.175+00:00");
forwardedMessage
.GetProperty("timestamp")
.GetString()
.Should()
.StartWith("2025-12-28T22:52:42.175+00:00");
}
}

View File

@@ -1,5 +1,6 @@
using System.Threading.Tasks;
using DiscordChatExporter.Cli.Tests.Infra;
using DiscordChatExporter.Cli.Tests.Utils.Extensions;
using FluentAssertions;
using Xunit;
@@ -14,6 +15,9 @@ public class PlainTextForwardSpecs
var document = await ExportWrapper.ExportAsPlainTextAsync(ChannelIds.ForwardTestCases);
// Assert
document.Should().ContainAll("{Forwarded Message}", @"¯\_(ツ)_/¯", "12/28/2025 10:52 PM");
document
.ReplaceWhiteSpace()
.Should()
.ContainAll("{Forwarded Message}", @"¯\_(ツ)_/¯", "12/28/2025 10:52 PM");
}
}