mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-11 18:36:45 +02:00
Make test assertions more relaxed in terms of user-made content URLs
This commit is contained in:
parent
5f343a46d1
commit
062427d143
2 changed files with 9 additions and 19 deletions
|
@ -27,13 +27,7 @@ public class HtmlAttachmentSpecs
|
|||
.QuerySelectorAll("a")
|
||||
.Select(e => e.GetAttribute("href"))
|
||||
.Should()
|
||||
.Contain(
|
||||
u =>
|
||||
u.StartsWith(
|
||||
"https://cdn.discordapp.com/attachments/885587741654536192/885587844964417596/Test.txt",
|
||||
StringComparison.Ordinal
|
||||
)
|
||||
);
|
||||
.Contain(u => u.Contains("Test.txt", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
@ -52,13 +46,7 @@ public class HtmlAttachmentSpecs
|
|||
.QuerySelectorAll("img")
|
||||
.Select(e => e.GetAttribute("src"))
|
||||
.Should()
|
||||
.Contain(
|
||||
u =>
|
||||
u.StartsWith(
|
||||
"https://cdn.discordapp.com/attachments/885587741654536192/885654862430359613/bird-thumbnail.png",
|
||||
StringComparison.Ordinal
|
||||
)
|
||||
);
|
||||
.Contain(u => u.Contains("bird-thumbnail.png", StringComparison.Ordinal));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.Linq;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using AngleSharp.Dom;
|
||||
using DiscordChatExporter.Cli.Tests.Infra;
|
||||
|
@ -54,7 +55,7 @@ public class HtmlEmbedSpecs
|
|||
.QuerySelectorAll("img")
|
||||
.Select(e => e.GetAttribute("src"))
|
||||
.WhereNotNull()
|
||||
.Where(s => s.EndsWith("f8w05ja8s4e61.png"))
|
||||
.Where(s => s.Contains("f8w05ja8s4e61.png", StringComparison.Ordinal))
|
||||
.Should()
|
||||
.ContainSingle();
|
||||
}
|
||||
|
@ -91,8 +92,9 @@ public class HtmlEmbedSpecs
|
|||
.WhereNotNull()
|
||||
.Where(
|
||||
s =>
|
||||
s.EndsWith(
|
||||
"i_am_currently_feeling_slight_displeasure_of_what_you_have_just_sent_lqrem.mp4"
|
||||
s.Contains(
|
||||
"i_am_currently_feeling_slight_displeasure_of_what_you_have_just_sent_lqrem.mp4",
|
||||
StringComparison.Ordinal
|
||||
)
|
||||
)
|
||||
.Should()
|
||||
|
@ -113,7 +115,7 @@ public class HtmlEmbedSpecs
|
|||
.QuerySelectorAll("source")
|
||||
.Select(e => e.GetAttribute("src"))
|
||||
.WhereNotNull()
|
||||
.Where(s => s.EndsWith("tooncasm-test-copy.mp4"))
|
||||
.Where(s => s.Contains("tooncasm-test-copy.mp4", StringComparison.Ordinal))
|
||||
.Should()
|
||||
.ContainSingle();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue