aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue_tracked_time_test.go
diff options
context:
space:
mode:
authorRené Schaar <rene@schaar.priv.at>2022-02-15 17:50:10 +0100
committerGitHub <noreply@github.com>2022-02-16 00:50:10 +0800
commit609c91665e5e4d6da50af0b2168d6cb46f9d6273 (patch)
tree974e777fbd7262162c4f3b237f3688178962e89c /models/issue_tracked_time_test.go
parent2be49dee71af997ed944c177a090aeb3e6d606e8 (diff)
downloadgitea-609c91665e5e4d6da50af0b2168d6cb46f9d6273.tar.gz
gitea-609c91665e5e4d6da50af0b2168d6cb46f9d6273.zip
Fix display time of milestones (#18753)
* Fix display time of milestones * Move the SecToTime function From the models/issue_stopwatch.go file to the modules/util package * Rename the sec_to_time file * Updated formatting * Include copyright notice in sec_to_time.go * Apply PR review suggestions - Update copyright notice dates to 2022 - Change `1 day 3h 5min 7s` to `1d 3h 5m 7s` * Rename hrs var and combine conditions * Update unit tests to match new time pattern Changed `1min` to `1m` Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'models/issue_tracked_time_test.go')
-rw-r--r--models/issue_tracked_time_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/models/issue_tracked_time_test.go b/models/issue_tracked_time_test.go
index 97efd8bb72..e6c9caf900 100644
--- a/models/issue_tracked_time_test.go
+++ b/models/issue_tracked_time_test.go
@@ -34,7 +34,7 @@ func TestAddTime(t *testing.T) {
assert.Equal(t, int64(3661), tt.Time)
comment := unittest.AssertExistsAndLoadBean(t, &Comment{Type: CommentTypeAddTimeManual, PosterID: 3, IssueID: 1}).(*Comment)
- assert.Equal(t, comment.Content, "1h 1min 1s")
+ assert.Equal(t, comment.Content, "1h 1m 1s")
}
func TestGetTrackedTimes(t *testing.T) {
@@ -86,7 +86,7 @@ func TestTotalTimes(t *testing.T) {
assert.Len(t, total, 1)
for user, time := range total {
assert.Equal(t, int64(1), user.ID)
- assert.Equal(t, "6min 40s", time)
+ assert.Equal(t, "6m 40s", time)
}
total, err = TotalTimes(&FindTrackedTimesOptions{IssueID: 2})
@@ -94,7 +94,7 @@ func TestTotalTimes(t *testing.T) {
assert.Len(t, total, 2)
for user, time := range total {
if user.ID == 2 {
- assert.Equal(t, "1h 1min 2s", time)
+ assert.Equal(t, "1h 1m 2s", time)
} else if user.ID == 1 {
assert.Equal(t, "20s", time)
} else {