mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-04-22 14:07:07 +00:00
Make test assertions more relaxed in terms of user-made content URLs
This commit is contained in:
@@ -27,13 +27,7 @@ public class HtmlAttachmentSpecs
|
|||||||
.QuerySelectorAll("a")
|
.QuerySelectorAll("a")
|
||||||
.Select(e => e.GetAttribute("href"))
|
.Select(e => e.GetAttribute("href"))
|
||||||
.Should()
|
.Should()
|
||||||
.Contain(
|
.Contain(u => u.Contains("Test.txt", StringComparison.Ordinal));
|
||||||
u =>
|
|
||||||
u.StartsWith(
|
|
||||||
"https://cdn.discordapp.com/attachments/885587741654536192/885587844964417596/Test.txt",
|
|
||||||
StringComparison.Ordinal
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
@@ -52,13 +46,7 @@ public class HtmlAttachmentSpecs
|
|||||||
.QuerySelectorAll("img")
|
.QuerySelectorAll("img")
|
||||||
.Select(e => e.GetAttribute("src"))
|
.Select(e => e.GetAttribute("src"))
|
||||||
.Should()
|
.Should()
|
||||||
.Contain(
|
.Contain(u => u.Contains("bird-thumbnail.png", StringComparison.Ordinal));
|
||||||
u =>
|
|
||||||
u.StartsWith(
|
|
||||||
"https://cdn.discordapp.com/attachments/885587741654536192/885654862430359613/bird-thumbnail.png",
|
|
||||||
StringComparison.Ordinal
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Linq;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AngleSharp.Dom;
|
using AngleSharp.Dom;
|
||||||
using DiscordChatExporter.Cli.Tests.Infra;
|
using DiscordChatExporter.Cli.Tests.Infra;
|
||||||
@@ -54,7 +55,7 @@ public class HtmlEmbedSpecs
|
|||||||
.QuerySelectorAll("img")
|
.QuerySelectorAll("img")
|
||||||
.Select(e => e.GetAttribute("src"))
|
.Select(e => e.GetAttribute("src"))
|
||||||
.WhereNotNull()
|
.WhereNotNull()
|
||||||
.Where(s => s.EndsWith("f8w05ja8s4e61.png"))
|
.Where(s => s.Contains("f8w05ja8s4e61.png", StringComparison.Ordinal))
|
||||||
.Should()
|
.Should()
|
||||||
.ContainSingle();
|
.ContainSingle();
|
||||||
}
|
}
|
||||||
@@ -91,8 +92,9 @@ public class HtmlEmbedSpecs
|
|||||||
.WhereNotNull()
|
.WhereNotNull()
|
||||||
.Where(
|
.Where(
|
||||||
s =>
|
s =>
|
||||||
s.EndsWith(
|
s.Contains(
|
||||||
"i_am_currently_feeling_slight_displeasure_of_what_you_have_just_sent_lqrem.mp4"
|
"i_am_currently_feeling_slight_displeasure_of_what_you_have_just_sent_lqrem.mp4",
|
||||||
|
StringComparison.Ordinal
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.Should()
|
.Should()
|
||||||
@@ -113,7 +115,7 @@ public class HtmlEmbedSpecs
|
|||||||
.QuerySelectorAll("source")
|
.QuerySelectorAll("source")
|
||||||
.Select(e => e.GetAttribute("src"))
|
.Select(e => e.GetAttribute("src"))
|
||||||
.WhereNotNull()
|
.WhereNotNull()
|
||||||
.Where(s => s.EndsWith("tooncasm-test-copy.mp4"))
|
.Where(s => s.Contains("tooncasm-test-copy.mp4", StringComparison.Ordinal))
|
||||||
.Should()
|
.Should()
|
||||||
.ContainSingle();
|
.ContainSingle();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user