Skip to content

Commit

Permalink
add TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
6543 committed Jun 3, 2020
1 parent 8964381 commit a0f06d5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions integrations/api_issue_reaction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,30 @@ 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))

for _, r := range *a {
assert.True(t, setting.UI.ReactionsMap[r])
}
}

func TestAPIIssuesReactions(t *testing.T) {
defer prepareTestEnv(t)()

Expand Down

0 comments on commit a0f06d5

Please sign in to comment.