mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-01 08:31:26 +00:00
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/5560 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Reviewed-by: Otto <otto@codeberg.org>
This commit is contained in:
commit
698b1c07c4
|
@ -13,8 +13,10 @@
|
||||||
{{svg "octicon-check" 16 "tw-mr-2"}}
|
{{svg "octicon-check" 16 "tw-mr-2"}}
|
||||||
{{ctx.Locale.PrettyNumber .ClosedCount}} {{ctx.Locale.Tr "repo.issues.closed_title"}}
|
{{ctx.Locale.PrettyNumber .ClosedCount}} {{ctx.Locale.Tr "repo.issues.closed_title"}}
|
||||||
</a>
|
</a>
|
||||||
|
{{if not .PageIsMilestones}}
|
||||||
<a class="{{if eq .State "all"}}active {{end}}item" href="{{.AllStatesLink}}" data-test-name="all-issue-count">
|
<a class="{{if eq .State "all"}}active {{end}}item" href="{{.AllStatesLink}}" data-test-name="all-issue-count">
|
||||||
{{svg "octicon-eye" 16 "tw-mr-2"}}
|
{{svg "octicon-eye" 16 "tw-mr-2"}}
|
||||||
{{ctx.Locale.PrettyNumber (.AllCount)}} {{ctx.Locale.Tr "repo.issues.all_title"}}
|
{{ctx.Locale.PrettyNumber (.AllCount)}} {{ctx.Locale.Tr "repo.issues.all_title"}}
|
||||||
</a>
|
</a>
|
||||||
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -23,3 +23,20 @@ func TestViewMilestones(t *testing.T) {
|
||||||
placeholder, _ := search.Attr("placeholder")
|
placeholder, _ := search.Attr("placeholder")
|
||||||
assert.Equal(t, "Search milestones...", placeholder)
|
assert.Equal(t, "Search milestones...", placeholder)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestMilestonesCount(t *testing.T) {
|
||||||
|
defer tests.PrepareTestEnv(t)()
|
||||||
|
|
||||||
|
req := NewRequest(t, "GET", "/user2/repo1/milestones")
|
||||||
|
resp := MakeRequest(t, req, http.StatusOK)
|
||||||
|
|
||||||
|
htmlDoc := NewHTMLParser(t, resp.Body)
|
||||||
|
|
||||||
|
openCount := htmlDoc.doc.Find("a[data-test-name='open-issue-count']").Text()
|
||||||
|
assert.Contains(t, openCount, "2\u00a0Open")
|
||||||
|
|
||||||
|
closedCount := htmlDoc.doc.Find("a[data-test-name='closed-issue-count']").Text()
|
||||||
|
assert.Contains(t, closedCount, "1\u00a0Closed")
|
||||||
|
|
||||||
|
assert.Empty(t, htmlDoc.doc.Find("a[data-test-name='all-issue-count']").Nodes)
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue