Commit dbe7f67685
Verified · cmc
e2e/filenav_test.go +7 −1
| @@ -10,7 +10,7 @@ import ( | ||
| 10 | 10 | // A file page lists its directory beside the file, marks the file, and |
| 11 | 11 | // links up (desktop layout spec). |
| 12 | 12 | func TestFileNavigator(t *testing.T) { |
| 13 | inst := startInstance(t) | |
| 13 | inst := startInstanceWith(t, "[web]\nmode = \"accounts\"\n") | |
| 14 | 14 | key := inst.newKey(t, "alice") |
| 15 | 15 | inst.admin(t, "admin", "user", "create", "alice", "--key", key+".pub") |
| 16 | 16 | if _, errOut, code := inst.ssh(t, key, "", "repo", "create", "alice/nav"); code != 0 { |
| @@ -49,4 +49,10 @@ func TestFileNavigator(t *testing.T) { | ||
| 49 | 49 | 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>`) { |
| 50 | 50 | t.Errorf("blame page lacks the root navigator:\n%s", body) |
| 51 | 51 | } |
| 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 | } | |
| 52 | 58 | } |