1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Web.MastodonAPI.MarkerViewTest do
6 use Pleroma.DataCase, async: true
7 alias Pleroma.Web.MastodonAPI.MarkerView
10 test "returns markers" do
11 marker1 = insert(:marker, timeline: "notifications", last_read_id: "17", unread_count: 5)
12 marker2 = insert(:marker, timeline: "home", last_read_id: "42")
14 assert MarkerView.render("markers.json", %{markers: [marker1, marker2]}) == %{
17 updated_at: NaiveDateTime.to_iso8601(marker2.updated_at),
19 pleroma: %{unread_count: 0}
23 updated_at: NaiveDateTime.to_iso8601(marker1.updated_at),
25 pleroma: %{unread_count: 5}