diff options
author | Ilja <pleroma@spectraltheorem.be> | 2021-08-14 18:42:12 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2021-08-14 18:42:12 +0000 |
commit | f9bafc17fbfa21991d7be80b028b83d56b804961 (patch) | |
tree | d6267b64e6840699811a40869fbf6803fe5d8e06 /test/pleroma/web/admin_api | |
parent | 97eb160c3e05dc8643bb6f44fe1e7db416e137d1 (diff) | |
download | pleroma-f9bafc17fbfa21991d7be80b028b83d56b804961.tar.gz |
List available frontends also when no static/frontends folder is present yet
* To see what front ends are installed, it ls static/frontends. When this folder doesn't exists yet, it will return an empty array.
* Installing still works since the folder is created during installation already
Diffstat (limited to 'test/pleroma/web/admin_api')
-rw-r--r-- | test/pleroma/web/admin_api/controllers/frontend_controller_test.exs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/pleroma/web/admin_api/controllers/frontend_controller_test.exs b/test/pleroma/web/admin_api/controllers/frontend_controller_test.exs index bc827cc12..200682ba9 100644 --- a/test/pleroma/web/admin_api/controllers/frontend_controller_test.exs +++ b/test/pleroma/web/admin_api/controllers/frontend_controller_test.exs @@ -42,6 +42,20 @@ defmodule Pleroma.Web.AdminAPI.FrontendControllerTest do refute Enum.any?(response, fn frontend -> frontend["installed"] == true end) end + + test "it lists available frontends when no frontend folder was created yet", %{conn: conn} do + File.rm_rf(@dir) + + response = + conn + |> get("/api/pleroma/admin/frontends") + |> json_response_and_validate_schema(:ok) + + assert Enum.map(response, & &1["name"]) == + Enum.map(Config.get([:frontends, :available]), fn {_, map} -> map["name"] end) + + refute Enum.any?(response, fn frontend -> frontend["installed"] == true end) + end end describe "POST /api/pleroma/admin/frontends/install" do |