diff options
author | Gusted <williamzijl7@hotmail.com> | 2022-05-16 09:49:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-16 17:49:17 +0800 |
commit | 71ca131582fff51da614291732ed43b2bf48d8a1 (patch) | |
tree | 0d7d69b3c5e2110ba00f7049e7b0bd08ef8fff75 /integrations | |
parent | d494cc335633ff838eaea547438b95e753aeec0f (diff) | |
download | gitea-71ca131582fff51da614291732ed43b2bf48d8a1.tar.gz gitea-71ca131582fff51da614291732ed43b2bf48d8a1.zip |
Fix issue overview for teams (#19652)
- Don't use hacky solution to limit to the correct RepoID's, instead use
current code to handle these limits. The existing code is more correct
than the hacky solution.
- Resolves #19636
- Add test-case
Diffstat (limited to 'integrations')
-rw-r--r-- | integrations/api_issue_test.go | 8 | ||||
-rw-r--r-- | integrations/api_nodeinfo_test.go | 2 | ||||
-rw-r--r-- | integrations/issue_test.go | 8 |
3 files changed, 9 insertions, 9 deletions
diff --git a/integrations/api_issue_test.go b/integrations/api_issue_test.go index 5ed5a0ad99..cc7d8d6bd5 100644 --- a/integrations/api_issue_test.go +++ b/integrations/api_issue_test.go @@ -209,7 +209,7 @@ func TestAPISearchIssues(t *testing.T) { req = NewRequest(t, "GET", link.String()) resp = MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.EqualValues(t, "15", resp.Header().Get("X-Total-Count")) + assert.EqualValues(t, "17", resp.Header().Get("X-Total-Count")) assert.Len(t, apiIssues, 10) // there are more but 10 is page item limit query.Add("limit", "20") @@ -217,14 +217,14 @@ func TestAPISearchIssues(t *testing.T) { req = NewRequest(t, "GET", link.String()) resp = MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.Len(t, apiIssues, 15) + assert.Len(t, apiIssues, 17) query = url.Values{"assigned": {"true"}, "state": {"all"}, "token": {token}} link.RawQuery = query.Encode() req = NewRequest(t, "GET", link.String()) resp = MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.Len(t, apiIssues, 1) + assert.Len(t, apiIssues, 2) query = url.Values{"milestones": {"milestone1"}, "state": {"all"}, "token": {token}} link.RawQuery = query.Encode() @@ -252,7 +252,7 @@ func TestAPISearchIssues(t *testing.T) { req = NewRequest(t, "GET", link.String()) resp = MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.Len(t, apiIssues, 3) + assert.Len(t, apiIssues, 5) query = url.Values{"owner": {"user3"}, "team": {"team1"}, "token": {token}} // organization + team link.RawQuery = query.Encode() diff --git a/integrations/api_nodeinfo_test.go b/integrations/api_nodeinfo_test.go index 822dbf3f0e..c2fcd2fea5 100644 --- a/integrations/api_nodeinfo_test.go +++ b/integrations/api_nodeinfo_test.go @@ -29,7 +29,7 @@ func TestNodeinfo(t *testing.T) { assert.True(t, nodeinfo.OpenRegistrations) assert.Equal(t, "gitea", nodeinfo.Software.Name) assert.Equal(t, 23, nodeinfo.Usage.Users.Total) - assert.Equal(t, 15, nodeinfo.Usage.LocalPosts) + assert.Equal(t, 17, nodeinfo.Usage.LocalPosts) assert.Equal(t, 2, nodeinfo.Usage.LocalComments) }) } diff --git a/integrations/issue_test.go b/integrations/issue_test.go index c6b801c9a6..8e04b99d5e 100644 --- a/integrations/issue_test.go +++ b/integrations/issue_test.go @@ -392,7 +392,7 @@ func TestSearchIssues(t *testing.T) { req = NewRequest(t, "GET", link.String()) resp = session.MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.EqualValues(t, "15", resp.Header().Get("X-Total-Count")) + assert.EqualValues(t, "17", resp.Header().Get("X-Total-Count")) assert.Len(t, apiIssues, 10) // there are more but 10 is page item limit query.Add("limit", "20") @@ -400,14 +400,14 @@ func TestSearchIssues(t *testing.T) { req = NewRequest(t, "GET", link.String()) resp = session.MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.Len(t, apiIssues, 15) + assert.Len(t, apiIssues, 17) query = url.Values{"assigned": {"true"}, "state": {"all"}} link.RawQuery = query.Encode() req = NewRequest(t, "GET", link.String()) resp = session.MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.Len(t, apiIssues, 1) + assert.Len(t, apiIssues, 2) query = url.Values{"milestones": {"milestone1"}, "state": {"all"}} link.RawQuery = query.Encode() @@ -435,7 +435,7 @@ func TestSearchIssues(t *testing.T) { req = NewRequest(t, "GET", link.String()) resp = session.MakeRequest(t, req, http.StatusOK) DecodeJSON(t, resp, &apiIssues) - assert.Len(t, apiIssues, 3) + assert.Len(t, apiIssues, 5) query = url.Values{"owner": {"user3"}, "team": {"team1"}} // organization + team link.RawQuery = query.Encode() |