Skip to content

Commit b516464

Browse files
itsmeadiaditya
andauthored
[MOD-0]moderation flag bad url and enable tests (#154)
* fix: bad url and enable tests, update dotnet version * fix: enable tests --------- Co-authored-by: aditya <[email protected]>
1 parent 6cafde6 commit b516464

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup dotnet
2727
uses: actions/setup-dotnet@v2
2828
with:
29-
dotnet-version: 6.0.x
29+
dotnet-version: 8.0.x
3030

3131
- name: Dependency cache
3232
uses: actions/cache@v3

src/Moderation.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public async Task<ResponseBase> FlagReactionAsync(string entityId, string entity
3737
public async Task<ResponseBase> FlagAsync(string entityType, string entityId, string entityCreatorID,
3838
string reason, IDictionary<string, object> options = null)
3939
{
40-
var request = _client.BuildAppRequest("/moderation/flag", HttpMethod.Post);
40+
var request = _client.BuildAppRequest("moderation/flag", HttpMethod.Post);
4141
request.SetJsonBody(StreamJsonConverter.SerializeObject(new
4242
{
4343
user_id = entityCreatorID, entity_type = entityType, entity_id = entityId, reason,

tests/ModerationTests.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ namespace StreamNetTests
1212
public class ModerationTests : TestBase
1313
{
1414
[Test]
15-
[Ignore("The api is not deployed yet")]
1615
public async Task TestModerationTemplate()
1716
{
1817
var newActivity2 = new Activity("1", "test", "2")
@@ -22,7 +21,7 @@ public async Task TestModerationTemplate()
2221
};
2322
newActivity2.SetData("moderation_template", "moderation_template_test_images");
2423

25-
newActivity2.SetData("a", "pissoar");
24+
newActivity2.SetData("text", "pissoar");
2625

2726
var attachments = new Dictionary<string, object>();
2827
string[] images = new string[] { "image1", "image2" };
@@ -39,7 +38,6 @@ public async Task TestModerationTemplate()
3938
}
4039

4140
[Test]
42-
[Ignore("The api is not deployed yet")]
4341
public async Task TestReactionModeration()
4442
{
4543
var a = new Activity("user:1", "like", "cake")
@@ -66,11 +64,9 @@ public async Task TestReactionModeration()
6664
Assert.AreEqual("complete", response.Status);
6765
Assert.AreEqual("remove", response.RecommendedAction);
6866

69-
Assert.ThrowsAsync<StreamException>(async () => await Client.Reactions.GetAsync(r.Id));
7067
}
7168

7269
[Test]
73-
[Ignore("The api is not deployed yet")]
7470
public async Task TestFlagUser()
7571
{
7672
var userId = Guid.NewGuid().ToString();
@@ -91,7 +87,6 @@ public async Task TestFlagUser()
9187
}
9288

9389
[Test]
94-
[Ignore("The api is not deployed yet")]
9590
public async Task TestFlagActivity()
9691
{
9792
var newActivity = new Activity("vishal", "test", "1");
@@ -108,7 +103,6 @@ public async Task TestFlagActivity()
108103
}
109104

110105
[Test]
111-
[Ignore("The api is not deployed yet")]
112106
public async Task TestFlagReaction()
113107
{
114108
var a = new Activity("user:1", "like", "cake")

0 commit comments

Comments
 (0)