summaryrefslogtreecommitdiff
path: root/test/pleroma/maps_test.exs
blob: 05f1b18b2a4663c7a1fc39c1fe64cc1c6b90bef1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Pleroma: A lightweight social networking server
# Copyright © 2024 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only

defmodule Pleroma.MapsTest do
  use Pleroma.DataCase, async: true

  alias Pleroma.Maps

  describe "filter_empty_values/1" do
    assert %{"bar" => "b", "ray" => ["foo"], "objs" => %{"a" => "b"}} ==
             Maps.filter_empty_values(%{
               "foo" => nil,
               "fooz" => "",
               "bar" => "b",
               "rei" => [],
               "ray" => ["foo"],
               "obj" => %{},
               "objs" => %{"a" => "b"}
             })
  end
end