Frontend mix task: Add tests.
authorlain <lain@soykaf.club>
Thu, 3 Sep 2020 09:40:17 +0000 (11:40 +0200)
committerlain <lain@soykaf.club>
Thu, 3 Sep 2020 09:40:17 +0000 (11:40 +0200)
test/tasks/frontend_test.exs

index 0ca2b9a28038f893d2b321d463a6bc41cad26b8b..022ae51be1a7cb8864906889b26c5b39a782417e 100644 (file)
@@ -48,11 +48,18 @@ defmodule Pleroma.FrontendTest do
       }
     })
 
+    folder = Path.join([@dir, "frontends", "pleroma", "fantasy"])
+    previously_existing = Path.join([folder, "temp"])
+    File.mkdir_p!(folder)
+    File.write!(previously_existing, "yey")
+    assert File.exists?(previously_existing)
+
     capture_io(fn ->
       Frontend.run(["install", "pleroma", "--file", "test/fixtures/tesla_mock/frontend.zip"])
     end)
 
-    assert File.exists?(Path.join([@dir, "frontends", "pleroma", "fantasy", "test.txt"]))
+    assert File.exists?(Path.join([folder, "test.txt"]))
+    refute File.exists?(previously_existing)
   end
 
   test "it downloads and unzips unknown frontends" do