Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
922B

  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.EmojiTest do
  5. use ExUnit.Case, async: true
  6. alias Pleroma.Emoji
  7. describe "get_all/0" do
  8. setup do
  9. emoji_list = Emoji.get_all()
  10. {:ok, emoji_list: emoji_list}
  11. end
  12. test "first emoji", %{emoji_list: emoji_list} do
  13. [emoji | _others] = emoji_list
  14. {code, %Emoji{file: path, tags: tags}} = emoji
  15. assert tuple_size(emoji) == 2
  16. assert is_binary(code)
  17. assert is_binary(path)
  18. assert is_list(tags)
  19. end
  20. test "random emoji", %{emoji_list: emoji_list} do
  21. emoji = Enum.random(emoji_list)
  22. {code, %Emoji{file: path, tags: tags}} = emoji
  23. assert tuple_size(emoji) == 2
  24. assert is_binary(code)
  25. assert is_binary(path)
  26. assert is_list(tags)
  27. end
  28. end
  29. end