From 90fe38ec83875e02875d54159a7d76696fc7d70b Mon Sep 17 00:00:00 2001 From: Robert Wolff Date: Sun, 28 Jul 2024 16:16:22 +0200 Subject: [PATCH] add integration test for check list numbers on issues list page --- tests/integration/issue_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/integration/issue_test.go b/tests/integration/issue_test.go index 470e2a8df7..e79c2ae55a 100644 --- a/tests/integration/issue_test.go +++ b/tests/integration/issue_test.go @@ -314,6 +314,21 @@ Description`) checkBoxes := issueContent.Find("input").FilterFunction(isCheckBox) assert.Equal(t, 8, checkBoxes.Length()) assert.Equal(t, 4, checkBoxes.FilterFunction(isChecked).Length()) + + // Issues list should show the correct numbers of checked and total checkboxes + repo, err := repo_model.GetRepositoryByOwnerAndName(db.DefaultContext, "user2", "repo1") + assert.NoError(t, err) + //repo = unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: repo.ID}) + req = NewRequestf(t, "GET", "%s/issues", repo.Link()) + resp = MakeRequest(t, req, http.StatusOK) + + htmlDoc := NewHTMLParser(t, resp.Body) + issuesSelection := htmlDoc.Find("#issue-list .flex-item") + assert.Equal(t, "4 / 8", strings.TrimSpace(issuesSelection.Find(".checklist").Text())) + value, _ := issuesSelection.Find("progress").Attr("value") + vmax, _ := issuesSelection.Find("progress").Attr("max") + assert.Equal(t, "4", value) + assert.Equal(t, "8", vmax) } func TestIssueDependencies(t *testing.T) {