From 00ca971390f07dc87b2206ededd06493ca20e6c6 Mon Sep 17 00:00:00 2001 From: Phantasm Date: Sun, 24 May 2026 00:49:32 +0200 Subject: [PATCH] FrontendStaticPlug: Add test for static files outside of index --- test/pleroma/web/plugs/frontend_static_plug_test.exs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/pleroma/web/plugs/frontend_static_plug_test.exs b/test/pleroma/web/plugs/frontend_static_plug_test.exs index b7c06eacd..7dc7e52cf 100644 --- a/test/pleroma/web/plugs/frontend_static_plug_test.exs +++ b/test/pleroma/web/plugs/frontend_static_plug_test.exs @@ -122,16 +122,27 @@ defmodule Pleroma.Web.Plugs.FrontendStaticPlugTest do clear_config([:frontends, :pickable], ["#{name}/#{ref}"]) path = "#{@dir}/frontends/#{name}/#{ref}" + path2 = "#{@dir}/frontends/#{name}/#{ref}/packs/html" Pleroma.Backports.mkdir_p!(path) File.write!("#{path}/index.html", "from frontend plug") + Pleroma.Backports.mkdir_p!(path2) + File.write!("#{path2}/custom.html", "from frontend plug") + index = conn |> put_req_cookie("preferred_frontend", "#{name}/#{ref}") |> get("/") assert html_response(index, 200) == "from frontend plug" + + custom = + conn + |> put_req_cookie("preferred_frontend", "#{name}/#{ref}") + |> get("/packs/html/custom.html") + + assert html_response(custom, 200) == "from frontend plug" end test "only returns content from pickable frontends", %{conn: conn} do