|
|
@ -11,11 +11,27 @@ import ( |
|
|
|
"time" |
|
|
|
|
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
api "code.gitea.io/gitea/modules/structs" |
|
|
|
|
|
|
|
"github.com/stretchr/testify/assert" |
|
|
|
) |
|
|
|
|
|
|
|
func TestAPIAllowedReactions(t *testing.T) { |
|
|
|
defer prepareTestEnv(t)() |
|
|
|
|
|
|
|
type allowed []string |
|
|
|
|
|
|
|
a := new(allowed) |
|
|
|
|
|
|
|
req := NewRequest(t, "GET", "/api/v1/settings/allowed_reactions") |
|
|
|
resp := MakeRequest(t, req, http.StatusOK) |
|
|
|
|
|
|
|
DecodeJSON(t, resp, &a) |
|
|
|
assert.Len(t, *a, len(setting.UI.Reactions)) |
|
|
|
assert.ElementsMatch(t, setting.UI.Reactions, *a) |
|
|
|
} |
|
|
|
|
|
|
|
func TestAPIIssuesReactions(t *testing.T) { |
|
|
|
defer prepareTestEnv(t)() |
|
|
|
|
|
|
|