logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

player_view_test.exs (989B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Web.Metadata.PlayerViewTest do
  5. use Pleroma.DataCase, async: true
  6. alias Pleroma.Web.Metadata.PlayerView
  7. test "it renders audio tag" do
  8. res =
  9. PlayerView.render(
  10. "player.html",
  11. %{"mediaType" => "audio", "href" => "test-href"}
  12. )
  13. |> Phoenix.HTML.safe_to_string()
  14. assert res ==
  15. "<audio controls><source src=\"test-href\" type=\"audio\">Your browser does not support audio playback.</audio>"
  16. end
  17. test "it renders videos tag" do
  18. res =
  19. PlayerView.render(
  20. "player.html",
  21. %{"mediaType" => "video", "href" => "test-href"}
  22. )
  23. |> Phoenix.HTML.safe_to_string()
  24. assert res ==
  25. "<video controls loop><source src=\"test-href\" type=\"video\">Your browser does not support video playback.</video>"
  26. end
  27. end