9a5720e8ad
Universal: PR Check / Branch Policy (pull_request) Successful in 1s
Branch Policy Check / Verify merge target (pull_request) Successful in 1s
PR RC Release / Build RC Release (pull_request) Successful in 3s
Universal: PR Check / Validate PR (pull_request) Failing after 6s
Branch Cleanup / Delete merged branch (pull_request) Successful in 1s
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Full namespace migration: update the Go module path and all import statements from git.mokoconsulting.tech to code.mokoconsulting.tech. Also updates all URL references in templates, workflows, configs, tests, and documentation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
57 lines
1.6 KiB
Go
57 lines
1.6 KiB
Go
// Copyright 2026 The Gitea Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package integration
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
"time"
|
|
|
|
"code.mokoconsulting.tech/MokoConsulting/MokoGitea/modules/timeutil"
|
|
"code.mokoconsulting.tech/MokoConsulting/MokoGitea/tests"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestHeatmapEndpoints(t *testing.T) {
|
|
defer tests.PrepareTestEnv(t)()
|
|
|
|
// Mock time so fixture actions fall within the heatmap's time window
|
|
timeutil.MockSet(time.Date(2021, 1, 1, 0, 0, 0, 0, time.UTC))
|
|
defer timeutil.MockUnset()
|
|
|
|
session := loginUser(t, "user2")
|
|
|
|
t.Run("UserProfile", func(t *testing.T) {
|
|
defer tests.PrintCurrentTest(t)()
|
|
req := NewRequest(t, "GET", "/user2/-/heatmap")
|
|
resp := session.MakeRequest(t, req, http.StatusOK)
|
|
|
|
result := DecodeJSON(t, resp, map[string]any{})
|
|
assert.Contains(t, result, "heatmapData")
|
|
assert.Contains(t, result, "totalContributions")
|
|
assert.Positive(t, result["totalContributions"])
|
|
})
|
|
|
|
t.Run("OrgDashboard", func(t *testing.T) {
|
|
defer tests.PrintCurrentTest(t)()
|
|
req := NewRequest(t, "GET", "/org/org3/dashboard/-/heatmap")
|
|
resp := session.MakeRequest(t, req, http.StatusOK)
|
|
|
|
result := DecodeJSON(t, resp, map[string]any{})
|
|
assert.Contains(t, result, "heatmapData")
|
|
assert.Contains(t, result, "totalContributions")
|
|
})
|
|
|
|
t.Run("OrgTeamDashboard", func(t *testing.T) {
|
|
defer tests.PrintCurrentTest(t)()
|
|
req := NewRequest(t, "GET", "/org/org3/dashboard/-/heatmap/team1")
|
|
resp := session.MakeRequest(t, req, http.StatusOK)
|
|
|
|
result := DecodeJSON(t, resp, map[string]any{})
|
|
assert.Contains(t, result, "heatmapData")
|
|
assert.Contains(t, result, "totalContributions")
|
|
})
|
|
}
|