Commit bee19b1e4d
bee19b1e4d837a393d797ddb98ecac12bf691e2b
parent: fce24ae002
Verified · cmc ci/build: success ci/test: success
cmc <hello@cleberg.net> · 2026-09-18 01:34 UTC
e2e: mirror and clone assertions read the new header and overview; no leading separator on the mirror line
Ref #218
e2e/mirror_test.go
+2 −2
| @@ -119,10 +119,10 @@ func TestMirrors(t *testing.T) { |
| 119 | 119 | if status, _ := browserGet(t, browser, inst.base()+loginPath); status != 200 { |
| 120 | 120 | t.Fatalf("login: %d", status) |
| 121 | 121 | } |
| 122 | | if _, body := browserGet(t, browser, inst.base()+"/alice/app"); !strings.Contains(body, "Mirrors to <a href=\""+remoteURL) { |
| 122 | if _, body := browserGet(t, browser, inst.base()+"/alice/app"); !strings.Contains(body, "mirrors to <a href=\""+remoteURL) { |
| 123 | 123 | t.Fatalf("admin repo page missing mirror line:\n%s", body) |
| 124 | 124 | } |
| 125 | | if _, body := browserGet(t, newBrowser(t), inst.base()+"/alice/app"); strings.Contains(body, "Mirrors to") { |
| 125 | if _, body := browserGet(t, newBrowser(t), inst.base()+"/alice/app"); strings.Contains(body, "mirrors to") { |
| 126 | 126 | t.Fatalf("anonymous repo page shows mirror line:\n%s", body) |
| 127 | 127 | } |
| 128 | 128 | |
e2e/web_test.go
+1 −1
| @@ -86,7 +86,7 @@ func TestWebUI(t *testing.T) { |
| 86 | 86 | t.Fatalf("repo home: %d\n%s", status, body) |
| 87 | 87 | } |
| 88 | 88 | // Both clone URLs: SSH for anyone with a key, HTTPS for reading. |
| 89 | | if !strings.Contains(body, "git clone ssh://git@gitbay.test:") || !strings.Contains(body, "/alice/site.git</code> · <code>git clone https://gitbay.test/alice/site.git</code>") { |
| 89 | if !strings.Contains(body, "git clone ssh://git@gitbay.test:") || !strings.Contains(body, "/alice/site.git</code></pre>") || !strings.Contains(body, "<code>git clone https://gitbay.test/alice/site.git</code>") { |
| 90 | 90 | t.Fatalf("clone URLs missing:\n%s", body) |
| 91 | 91 | } |
| 92 | 92 | if !strings.Contains(body, "<h2 id=\"hello-site\">hello site</h2>") || !strings.Contains(body, "<em>markdown</em>") { |
internal/web/templates/layout.html
+1 −1
| @@ -76,7 +76,7 @@ |
| 76 | 76 | is identical on every page within a tab. */}} |
| 77 | 77 | {{if eq $top "code"}} |
| 78 | 78 | <p class="repodesc">{{with field $ "Desc"}}{{.}}{{end}} {{with field $ "Topics"}}{{range .}}<a class="chip topic" href="/explore?q={{.}}">{{.}}</a> {{end}}{{end}}</p> |
| 79 | | {{if or $.Repo.Settings.Website (field $ "Mirrors")}}<p class="repometa">{{with $.Repo.Settings.Website}}<a href="{{.}}" rel="nofollow">{{.}}</a>{{end}}{{range field $ "Mirrors"}} · {{if eq .Direction "push"}}mirrors to{{else}}mirrors from{{end}} <a href="{{.URL}}" rel="nofollow">{{.Target}}</a>{{if .Error}}, <span class="bad">sync error: {{.Error}}</span>{{else if .Synced}}, synced {{.Synced}}{{end}}{{end}}</p>{{end}} |
| 79 | {{if or $.Repo.Settings.Website (field $ "Mirrors")}}<p class="repometa">{{with $.Repo.Settings.Website}}<a href="{{.}}" rel="nofollow">{{.}}</a>{{end}}{{range $i, $m := field $ "Mirrors"}}{{if or $i $.Repo.Settings.Website}} · {{end}}{{if eq $m.Direction "push"}}mirrors to{{else}}mirrors from{{end}} <a href="{{$m.URL}}" rel="nofollow">{{$m.Target}}</a>{{if $m.Error}}, <span class="bad">sync error: {{$m.Error}}</span>{{else if $m.Synced}}, synced {{$m.Synced}}{{end}}{{end}}</p>{{end}} |
| 80 | 80 | {{if $.Viewer}}<p class="toggles">Pinned shows in your rail. Watching sends every issue, request and build to your inbox. Bookmarked lists it under Bookmarks.</p>{{end}} |
| 81 | 81 | {{end}} |
| 82 | 82 | <nav class="tabs" aria-label="Repository"> |