diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-06-16 14:32:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-16 06:32:43 +0000 |
commit | b71cb7acdc8840c9fc16b496c90a048051d15823 (patch) | |
tree | fae5454a2c9f1a7d510255260b562519681841c0 /tests | |
parent | a305c37e62eca42aaad16b4521520bad6bca58d2 (diff) | |
download | gitea-b71cb7acdc8840c9fc16b496c90a048051d15823.tar.gz gitea-b71cb7acdc8840c9fc16b496c90a048051d15823.zip |
Use fetch to send requests to create issues/comments (#25258)
Follow #23290
Network error won't make content lost. And this is a much better
approach than "loading-button".
The UI is not perfect and there are still some TODOs, they can be done
in following PRs, not a must in this PR's scope.
<details>
![image](https://github.com/go-gitea/gitea/assets/2114189/c94ba958-aa46-4747-8ddf-6584deeed25c)
</details>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/attachment_test.go | 2 | ||||
-rw-r--r-- | tests/integration/issue_test.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/tests/integration/attachment_test.go b/tests/integration/attachment_test.go index ff62726487..8206d8f4dc 100644 --- a/tests/integration/attachment_test.go +++ b/tests/integration/attachment_test.go @@ -83,7 +83,7 @@ func TestCreateIssueAttachment(t *testing.T) { } req = NewRequestWithValues(t, "POST", link, postData) - resp = session.MakeRequest(t, req, http.StatusSeeOther) + resp = session.MakeRequest(t, req, http.StatusOK) test.RedirectURL(resp) // check that redirect URL exists // Validate that attachment is available diff --git a/tests/integration/issue_test.go b/tests/integration/issue_test.go index 7ea7fefb64..ab2986906b 100644 --- a/tests/integration/issue_test.go +++ b/tests/integration/issue_test.go @@ -135,7 +135,7 @@ func testNewIssue(t *testing.T, session *TestSession, user, repo, title, content "title": title, "content": content, }) - resp = session.MakeRequest(t, req, http.StatusSeeOther) + resp = session.MakeRequest(t, req, http.StatusOK) issueURL := test.RedirectURL(resp) req = NewRequest(t, "GET", issueURL) @@ -165,7 +165,7 @@ func testIssueAddComment(t *testing.T, session *TestSession, issueURL, content, "content": content, "status": status, }) - resp = session.MakeRequest(t, req, http.StatusSeeOther) + resp = session.MakeRequest(t, req, http.StatusOK) req = NewRequest(t, "GET", test.RedirectURL(resp)) resp = session.MakeRequest(t, req, http.StatusOK) |