From 9986df32a435dd57cf2d29797bed8afefb1cc06f Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Tue, 6 Oct 2026 18:05:09 +0200 Subject: [PATCH] test(02-01): add failing test for the presentations prefix - /_presentations must be a plain 404, not the SPA shell - A router without the presentations plugin has no public document route --- plugin_test.go | 5 +++++ static_test.go | 1 + 2 files changed, 6 insertions(+) diff --git a/plugin_test.go b/plugin_test.go index e187844..a34d844 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -165,6 +165,11 @@ func TestRoutes(t *testing.T) { if !slices.Equal(got, want) { t.Errorf("routes =\n%v\nwant\n%v", got, want) } + for _, rt := range router.Routes() { + if rt.Pattern == "/prezentacje/{slugHash}" { + t.Errorf("GET /prezentacje/{slugHash} is registered without golem15.presentations") + } + } } func TestAdminCompiles(t *testing.T) { diff --git a/static_test.go b/static_test.go index 1c2484e..78f9b48 100644 --- a/static_test.go +++ b/static_test.go @@ -113,6 +113,7 @@ func TestStaticReservedPaths(t *testing.T) { h := handler(t, "/bmadmin") for _, p := range []string{ "/_user", "/_user/", "/_user/api/v1/nope", "/_bm/api/v1/nope", "/_quizzes/api/v1/nope", + "/_presentations", "/_presentations/api/v1/nope", "/bmadmin", "/bmadmin/", "/bmadmin/login", "/storage/app/uploads/public/x.pdf", "/storage", "/_user/../_user/x", "//_bm/api", } {