projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
upload emoji zip file
[akkoma]
/
test
/
chat_test.exs
diff --git
a/test/chat_test.exs
b/test/chat_test.exs
index 42e01fe2728933405e52be8f16970ba1ded9e8c8..332f2180a1d5e92dc0d837cc1b9f9da8ba7525e2 100644
(file)
--- a/
test/chat_test.exs
+++ b/
test/chat_test.exs
@@
-6,7
+6,6
@@
defmodule Pleroma.ChatTest do
use Pleroma.DataCase, async: true
alias Pleroma.Chat
use Pleroma.DataCase, async: true
alias Pleroma.Chat
- alias Pleroma.Web.CommonAPI
import Pleroma.Factory
import Pleroma.Factory
@@
-35,7
+34,6
@@
defmodule Pleroma.ChatTest do
{:ok, chat_two} = Chat.bump_or_create(user.id, other_user.ap_id)
assert chat.id == chat_two.id
{:ok, chat_two} = Chat.bump_or_create(user.id, other_user.ap_id)
assert chat.id == chat_two.id
- assert chat_two.unread == 2
end
test "it returns a chat for a user and recipient if it already exists" do
end
test "it returns a chat for a user and recipient if it already exists" do
@@
-48,15
+46,13
@@
defmodule Pleroma.ChatTest do
assert chat.id == chat_two.id
end
assert chat.id == chat_two.id
end
- test "a returning chat will have an updated `update_at` field
and an incremented unread count
" do
+ test "a returning chat will have an updated `update_at` field" do
user = insert(:user)
other_user = insert(:user)
{:ok, chat} = Chat.bump_or_create(user.id, other_user.ap_id)
user = insert(:user)
other_user = insert(:user)
{:ok, chat} = Chat.bump_or_create(user.id, other_user.ap_id)
- assert chat.unread == 1
:timer.sleep(1500)
{:ok, chat_two} = Chat.bump_or_create(user.id, other_user.ap_id)
:timer.sleep(1500)
{:ok, chat_two} = Chat.bump_or_create(user.id, other_user.ap_id)
- assert chat_two.unread == 2
assert chat.id == chat_two.id
assert chat.updated_at != chat_two.updated_at
assert chat.id == chat_two.id
assert chat.updated_at != chat_two.updated_at