Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit e241820

Browse files
committed
refactor(article-comments): clean up
1 parent 4eac5ff commit e241820

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

test/groupher_server_web/query/cms/article_comment_test.exs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,24 +288,23 @@ defmodule GroupherServer.Test.Query.ArticleComment do
288288
assert results["totalCount"] == total_count + 2
289289
end
290290

291-
@tag :wip
291+
@tag :wip2
292292
test "guest user can get paged comment with floor it", ~m(guest_conn post user)a do
293-
total_count = 10
293+
total_count = 5
294294
thread = :post
295295
page_size = 10
296296

297297
Enum.reduce(1..total_count, [], fn _, acc ->
298298
{:ok, comment} = CMS.create_article_comment(thread, post.id, "test comment", user)
299-
Process.sleep(500)
300-
299+
Process.sleep(1000)
301300
acc ++ [comment]
302301
end)
303302

304303
variables = %{id: post.id, thread: "POST", filter: %{page: 1, size: page_size}}
305304
results = guest_conn |> query_result(@query, variables, "pagedArticleComments")
306305

307306
assert results["entries"] |> List.first() |> Map.get("floor") == 1
308-
assert results["entries"] |> List.last() |> Map.get("floor") == 10
307+
assert results["entries"] |> List.last() |> Map.get("floor") == 5
309308
end
310309

311310
@tag :wip
@@ -522,8 +521,8 @@ defmodule GroupherServer.Test.Query.ArticleComment do
522521
acc ++ [comment]
523522
end)
524523

525-
{:ok, comment} = CMS.create_article_comment(:post, post.id, "commment", user)
526-
{:ok, comment} = CMS.create_article_comment(:post, post.id, "commment", user)
524+
{:ok, _comment} = CMS.create_article_comment(:post, post.id, "commment", user)
525+
{:ok, _comment} = CMS.create_article_comment(:post, post.id, "commment", user)
527526

528527
variables = %{id: post.id, thread: thread, filter: %{page: 1, size: page_size}}
529528

0 commit comments

Comments
 (0)