Commit dbe7f67685

dbe7f676856d6b8577b55f09792f85bd81955f17

parent: 746c5176bc

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-19 16:26 UTC

e2e: cover the edit page's file navigator

Ref #226
e2e/filenav_test.go +7 −1
@@ -10,7 +10,7 @@ import (
1010// A file page lists its directory beside the file, marks the file, and
1111// links up (desktop layout spec).
1212func TestFileNavigator(t *testing.T) {
13 inst := startInstance(t)
13 inst := startInstanceWith(t, "[web]\nmode = \"accounts\"\n")
1414 key := inst.newKey(t, "alice")
1515 inst.admin(t, "admin", "user", "create", "alice", "--key", key+".pub")
1616 if _, errOut, code := inst.ssh(t, key, "", "repo", "create", "alice/nav"); code != 0 {
@@ -49,4 +49,10 @@ func TestFileNavigator(t *testing.T) {
4949 if !strings.Contains(body, `<h2 class="colhead">nav</h2>`) || !strings.Contains(body, `<a aria-current="page" href="/alice/nav/blob/main/README.md">README.md</a>`) {
5050 t.Errorf("blame page lacks the root navigator:\n%s", body)
5151 }
52
53 alice := inst.login(t, key)
54 status, body = browserGet(t, alice, inst.base()+"/alice/nav/edit/main/cmd/main.go")
55 if status != 200 || !strings.Contains(body, `<h2 class="colhead">cmd</h2>`) || !strings.Contains(body, `<a aria-current="page" href="/alice/nav/blob/main/cmd/main.go">main.go</a>`) {
56 t.Errorf("edit page lacks the navigator: %d\n%s", status, body)
57 }
5258}