summaryrefslogtreecommitdiffstats
path: root/integrations
diff options
context:
space:
mode:
authorNorwin <noerw@users.noreply.github.com>2021-01-21 14:51:52 +0000
committerGitHub <noreply@github.com>2021-01-21 15:51:52 +0100
commitb5570d3e680570343c1552bfc972b19b161209cd (patch)
tree548fbcdb9a760b47c54ac931c0180d87d08029d5 /integrations
parent56a89296050096df29d0a653019c194631cc6562 (diff)
downloadgitea-b5570d3e680570343c1552bfc972b19b161209cd.tar.gz
gitea-b5570d3e680570343c1552bfc972b19b161209cd.zip
Display current stopwatch in navbar (#14122)
* add notification about running stopwatch to header * serialize seconds, duration in stopwatches api * ajax update stopwatch i should get my testenv working locally... * new variant: hover dialog * noscript compatibility * js: live-update stopwatch time * js live update robustness
Diffstat (limited to 'integrations')
-rw-r--r--integrations/api_issue_stopwatch_test.go14
-rw-r--r--integrations/attachment_test.go2
2 files changed, 6 insertions, 10 deletions
diff --git a/integrations/api_issue_stopwatch_test.go b/integrations/api_issue_stopwatch_test.go
index 39b9b97411..c0b8fd9c69 100644
--- a/integrations/api_issue_stopwatch_test.go
+++ b/integrations/api_issue_stopwatch_test.go
@@ -7,7 +7,6 @@ package integrations
import (
"net/http"
"testing"
- "time"
"code.gitea.io/gitea/models"
api "code.gitea.io/gitea/modules/structs"
@@ -31,14 +30,11 @@ func TestAPIListStopWatches(t *testing.T) {
issue := models.AssertExistsAndLoadBean(t, &models.Issue{ID: stopwatch.IssueID}).(*models.Issue)
if assert.Len(t, apiWatches, 1) {
assert.EqualValues(t, stopwatch.CreatedUnix.AsTime().Unix(), apiWatches[0].Created.Unix())
- apiWatches[0].Created = time.Time{}
- assert.EqualValues(t, api.StopWatch{
- Created: time.Time{},
- IssueIndex: issue.Index,
- IssueTitle: issue.Title,
- RepoName: repo.Name,
- RepoOwnerName: repo.OwnerName,
- }, *apiWatches[0])
+ assert.EqualValues(t, issue.Index, apiWatches[0].IssueIndex)
+ assert.EqualValues(t, issue.Title, apiWatches[0].IssueTitle)
+ assert.EqualValues(t, repo.Name, apiWatches[0].RepoName)
+ assert.EqualValues(t, repo.OwnerName, apiWatches[0].RepoOwnerName)
+ assert.Greater(t, int64(apiWatches[0].Seconds), int64(0))
}
}
diff --git a/integrations/attachment_test.go b/integrations/attachment_test.go
index dd734145d2..a28e38b990 100644
--- a/integrations/attachment_test.go
+++ b/integrations/attachment_test.go
@@ -72,7 +72,7 @@ func TestCreateIssueAttachment(t *testing.T) {
resp := session.MakeRequest(t, req, http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
- link, exists := htmlDoc.doc.Find("form").Attr("action")
+ link, exists := htmlDoc.doc.Find("form#new-issue").Attr("action")
assert.True(t, exists, "The template has changed")
postData := map[string]string{