Skip to content

Commit

Permalink
ignore reaction test on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalnarkhede committed Jul 24, 2024
1 parent 5c0f288 commit 4cd0e8b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
31 changes: 31 additions & 0 deletions tests/ModerationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,37 @@ public async Task TestModerationTemplate()
Assert.AreEqual(modResponse.RecommendedAction, "remove");
}

[Test]
[Ignore("The api is not deployed yet")]
public async Task TestReactionModeration()
{
var a = new Activity("user:1", "like", "cake")
{
ForeignId = "cake:1",
Time = DateTime.UtcNow,
Target = "johnny",
};

var activity = await this.UserFeed.AddActivityAsync(a);

var data = new Dictionary<string, object>() { { "field", "value" }, { "number", 2 }, { "text", "pissoar" }, };

var r = await Client.Reactions.AddAsync("like", activity.Id, "bobby", data, null, "moderation_config_1_reaction");

Assert.NotNull(r);
Assert.AreEqual(r.ActivityId, activity.Id);
Assert.AreEqual(r.Kind, "like");
Assert.AreEqual(r.UserId, "bobby");
Assert.AreEqual(r.Data, data);

var response = r.GetModerationResponse();

Assert.AreEqual("complete", response.Status);
Assert.AreEqual("remove", response.RecommendedAction);

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

[Test]
[Ignore("The api is not deployed yet")]
public async Task TestFlagUser()
Expand Down
30 changes: 0 additions & 30 deletions tests/ReactionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,36 +83,6 @@ public async Task TestReactions()
Assert.ThrowsAsync<StreamException>(async () => await Client.Reactions.GetAsync(r.Id));
}

[Test]
public async Task TestReactionModeration()
{
var a = new Activity("user:1", "like", "cake")
{
ForeignId = "cake:1",
Time = DateTime.UtcNow,
Target = "johnny",
};

var activity = await this.UserFeed.AddActivityAsync(a);

var data = new Dictionary<string, object>() { { "field", "value" }, { "number", 2 }, { "text", "pissoar" }, };

var r = await Client.Reactions.AddAsync("like", activity.Id, "bobby", data, null, "moderation_config_1_reaction");

Assert.NotNull(r);
Assert.AreEqual(r.ActivityId, activity.Id);
Assert.AreEqual(r.Kind, "like");
Assert.AreEqual(r.UserId, "bobby");
Assert.AreEqual(r.Data, data);

var response = r.GetModerationResponse();

Assert.AreEqual("complete", response.Status);
Assert.AreEqual("remove", response.RecommendedAction);

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

[Test]
public async Task TestReactionPagination()
{
Expand Down

0 comments on commit 4cd0e8b

Please sign in to comment.