diff options
author | 6543 <6543@obermui.de> | 2020-06-04 11:16:53 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-04 12:16:53 +0300 |
commit | b534a5164fe13dc41aa2996239c2dff4f109dee0 (patch) | |
tree | d790711e74321cb0344eafa33f2eeb594e68cb07 /integrations | |
parent | 2842f6cf42ab984a7f533a51a050425ebaa2313b (diff) | |
download | gitea-b534a5164fe13dc41aa2996239c2dff4f109dee0.tar.gz gitea-b534a5164fe13dc41aa2996239c2dff4f109dee0.zip |
[API] Expose allowed Reactions (#11735)
* [API] Expose allowed Reactions
* dont be in soutch a rush
* add TEST
* use ElementsMatch
Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'integrations')
-rw-r--r-- | integrations/api_issue_reaction_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/integrations/api_issue_reaction_test.go b/integrations/api_issue_reaction_test.go index 1906b8d090..ab3de7c116 100644 --- a/integrations/api_issue_reaction_test.go +++ b/integrations/api_issue_reaction_test.go @@ -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)() |