From 4ef3e85d16879587edb5b2f548fc168a1aa64041 Mon Sep 17 00:00:00 2001 From: Mathias Date: Sat, 3 Oct 2026 21:05:16 +0200 Subject: [PATCH] test(web): the home list links to recordings only when uploads are mounted (#37), red Co-Authored-By: Claude Sonnet 5.5 --- internal/web/uploads_nav_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 internal/web/uploads_nav_test.go diff --git a/internal/web/uploads_nav_test.go b/internal/web/uploads_nav_test.go new file mode 100644 index 0000000..bf62bdd --- /dev/null +++ b/internal/web/uploads_nav_test.go @@ -0,0 +1,19 @@ +package web_test + +// /uploads was mounted but nothing linked to it (#37). The shared Layout has no access to +// the App, so the entry point is the home list, shown only when uploads are mounted. + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestHomeList_LinksToRecordingsOnlyWhenUploadsAreMounted(t *testing.T) { + with, _ := newUploadApp(t, audioOK, 200<<20) + without := newApp(t) + + assert.Contains(t, body(t, do(t, with, get("/"))), `href="/uploads"`) + assert.NotContains(t, body(t, do(t, without, get("/"))), `href="/uploads"`, + "a link to a route that is not mounted would be a dead end") +}