diff options
author | tusooa <tusooa@kazv.moe> | 2022-07-23 00:34:15 +0000 |
---|---|---|
committer | tusooa <tusooa@kazv.moe> | 2022-07-23 00:34:15 +0000 |
commit | 301ce5bc627d91b21c33af73eeb266025cd14728 (patch) | |
tree | b85308ca1611eac60b6ed339d11d5bed450320ab /test | |
parent | 21e587ff1ab2b874a4eb5ca811c6e98c8486b55e (diff) | |
parent | 597f56b4c4db3c63ff66fc93717d3b20655e1543 (diff) | |
download | pleroma-301ce5bc627d91b21c33af73eeb266025cd14728.tar.gz pleroma-301ce5bc627d91b21c33af73eeb266025cd14728.zip |
Merge branch 'mute-expiration' into 'develop'
MastoAPI: Show mutes expiration date
See merge request pleroma/pleroma!3682
Diffstat (limited to 'test')
-rw-r--r-- | test/pleroma/web/mastodon_api/views/account_view_test.exs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs index 8ed37fe58..8fa946d43 100644 --- a/test/pleroma/web/mastodon_api/views/account_view_test.exs +++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs @@ -634,4 +634,21 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do |> assert() end end + + test "renders mute expiration date" do + user = insert(:user) + other_user = insert(:user) + + {:ok, _user_relationships} = + User.mute(user, other_user, %{notifications: true, expires_in: 24 * 60 * 60}) + + %{ + mute_expires_at: mute_expires_at + } = AccountView.render("show.json", %{user: other_user, for: user, mutes: true}) + + assert DateTime.diff( + mute_expires_at, + DateTime.utc_now() |> DateTime.add(24 * 60 * 60) + ) in -3..3 + end end |