aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline.Tests
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-04-18 22:34:06 +0800
committercrupest <crupest@outlook.com>2021-04-18 22:34:06 +0800
commitb00ee7bc9d59aa008e7d196e6a9c28b6bba307d0 (patch)
treef311a556e867bfeed5abd15dcefd0b6599c2b724 /BackEnd/Timeline.Tests
parentf8db4c0b058c557c79ace5823ed5ab69b42c57d2 (diff)
downloadtimeline-b00ee7bc9d59aa008e7d196e6a9c28b6bba307d0.tar.gz
timeline-b00ee7bc9d59aa008e7d196e6a9c28b6bba307d0.tar.bz2
timeline-b00ee7bc9d59aa008e7d196e6a9c28b6bba307d0.zip
fix: Fix a bug in HasPostModifyPermission.
Diffstat (limited to 'BackEnd/Timeline.Tests')
-rw-r--r--BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs17
1 files changed, 17 insertions, 0 deletions
diff --git a/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs b/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs
index f00d9b13..68a75898 100644
--- a/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs
+++ b/BackEnd/Timeline.Tests/IntegratedTests/TimelinePostTest.cs
@@ -618,5 +618,22 @@ namespace Timeline.Tests.IntegratedTests
markdown.Should().MatchRegex(@$"\[aaa\]\(https?://.*/timelines/{generator(1)}/posts/{post.Id}/data/1\)");
markdown.Should().MatchRegex(@$"\[bbb\]\(https?://.*/timelines/{generator(1)}/posts/{post.Id}/data/2\)");
}
+
+ [Theory]
+ [MemberData(nameof(TimelineNameGeneratorTestData))]
+ public async Task Post_Markdown_Delete_Test(TimelineNameGenerator generator)
+ {
+ {
+ using var client = await CreateClientAs(2);
+ var post = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(2)}/posts", CreateMarkdownPostRequest("[aaa](https://crupest.life)"));
+ await client.TestDeleteAsync($"timelines/{generator(2)}/posts/{post.Id}");
+ }
+
+ {
+ using var client = await CreateClientAsUser();
+ var post = await client.TestPostAsync<HttpTimelinePost>($"timelines/{generator(1)}/posts", CreateMarkdownPostRequest("[aaa](https://crupest.life)"));
+ await client.TestDeleteAsync($"timelines/{generator(1)}/posts/{post.Id}");
+ }
+ }
}
}