mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
API: Move AllowedReactions endpoint into GetGenneralUI endpoint + creat new swagger section settings (#11854)
* move Setting function into its own package * swagger add&use new section "settings" * move api AllowedReactions into general UI-Settings endpoint * prepare TEST * lint
This commit is contained in:
@@ -20,16 +20,14 @@ import (
|
||||
func TestAPIAllowedReactions(t *testing.T) {
|
||||
defer prepareTestEnv(t)()
|
||||
|
||||
type allowed []string
|
||||
a := new(api.GeneralUISettings)
|
||||
|
||||
a := new(allowed)
|
||||
|
||||
req := NewRequest(t, "GET", "/api/v1/settings/allowed_reactions")
|
||||
req := NewRequest(t, "GET", "/api/v1/settings/ui")
|
||||
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)
|
||||
assert.Len(t, a.AllowedReactions, len(setting.UI.Reactions))
|
||||
assert.ElementsMatch(t, setting.UI.Reactions, a.AllowedReactions)
|
||||
}
|
||||
|
||||
func TestAPIIssuesReactions(t *testing.T) {
|
||||
|
Reference in New Issue
Block a user