Add more tests for Hunter.Notification
parent
3473d33566
commit
f532c63340
|
@ -28,4 +28,20 @@ defmodule Hunter.NotificationTest do
|
||||||
assert "paperswelove" == notification.account.username
|
assert "paperswelove" == notification.account.username
|
||||||
assert "follow" == notification.type
|
assert "follow" == notification.type
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "deletes all notifications from Mastodon server" do
|
||||||
|
expect(Hunter.ApiMock, :clear_notifications, fn _conn ->
|
||||||
|
true
|
||||||
|
end)
|
||||||
|
|
||||||
|
assert Notification.clear_notifications(@conn)
|
||||||
|
end
|
||||||
|
|
||||||
|
test "dismiss a single notification" do
|
||||||
|
expect(Hunter.ApiMock, :clear_notification, fn _conn, _id ->
|
||||||
|
true
|
||||||
|
end)
|
||||||
|
|
||||||
|
assert Notification.clear_notification(@conn, 17_476)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue