From b00ee7bc9d59aa008e7d196e6a9c28b6bba307d0 Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 18 Apr 2021 22:34:06 +0800 Subject: fix: Fix a bug in HasPostModifyPermission. --- .../Timeline.Tests/IntegratedTests/TimelinePostTest.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'BackEnd/Timeline.Tests') 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($"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($"timelines/{generator(1)}/posts", CreateMarkdownPostRequest("[aaa](https://crupest.life)")); + await client.TestDeleteAsync($"timelines/{generator(1)}/posts/{post.Id}"); + } + } } } -- cgit v1.2.3