summaryrefslogtreecommitdiff
path: root/internal/api/client/admin/emojiupdate_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-06-18 18:18:00 +0200
committerLibravatar GitHub <noreply@github.com>2024-06-18 18:18:00 +0200
commitd2b3d37724a999d4cc78c46157593267e29d184e (patch)
treeac72be127d8adb80bbd756ad970ae14df7b5618f /internal/api/client/admin/emojiupdate_test.go
parent[feature] Implement types[] param for notifications (#3009) (diff)
downloadgotosocial-d2b3d37724a999d4cc78c46157593267e29d184e.tar.xz
[feature/frontend] Reports frontend v2 (#3022)
* use apiutil + paging in admin processor+handlers * we're making it happen * fix little whoopsie * styling for report list * don't youuuu forget about meee don't don't don't don't * last bits * sanitize content before showing in report statuses * update report docs
Diffstat (limited to 'internal/api/client/admin/emojiupdate_test.go')
-rw-r--r--internal/api/client/admin/emojiupdate_test.go23
1 files changed, 12 insertions, 11 deletions
diff --git a/internal/api/client/admin/emojiupdate_test.go b/internal/api/client/admin/emojiupdate_test.go
index eb9d9d866..676363e39 100644
--- a/internal/api/client/admin/emojiupdate_test.go
+++ b/internal/api/client/admin/emojiupdate_test.go
@@ -28,6 +28,7 @@ import (
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/api/client/admin"
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
+ apiutil "github.com/superseriousbusiness/gotosocial/internal/api/util"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/testrig"
)
@@ -53,7 +54,7 @@ func (suite *EmojiUpdateTestSuite) TestEmojiUpdateNewCategory() {
bodyBytes := requestBody.Bytes()
recorder := httptest.NewRecorder()
ctx := suite.newContext(recorder, http.MethodPost, bodyBytes, admin.EmojiPathWithID, w.FormDataContentType())
- ctx.AddParam(admin.IDKey, testEmoji.ID)
+ ctx.AddParam(apiutil.IDKey, testEmoji.ID)
// call the handler
suite.adminModule.EmojiPATCHHandler(ctx)
@@ -130,7 +131,7 @@ func (suite *EmojiUpdateTestSuite) TestEmojiUpdateSwitchCategory() {
bodyBytes := requestBody.Bytes()
recorder := httptest.NewRecorder()
ctx := suite.newContext(recorder, http.MethodPost, bodyBytes, admin.EmojiPathWithID, w.FormDataContentType())
- ctx.AddParam(admin.IDKey, testEmoji.ID)
+ ctx.AddParam(apiutil.IDKey, testEmoji.ID)
// call the handler
suite.adminModule.EmojiPATCHHandler(ctx)
@@ -208,7 +209,7 @@ func (suite *EmojiUpdateTestSuite) TestEmojiUpdateCopyRemoteToLocal() {
bodyBytes := requestBody.Bytes()
recorder := httptest.NewRecorder()
ctx := suite.newContext(recorder, http.MethodPost, bodyBytes, admin.EmojiPathWithID, w.FormDataContentType())
- ctx.AddParam(admin.IDKey, testEmoji.ID)
+ ctx.AddParam(apiutil.IDKey, testEmoji.ID)
// call the handler
suite.adminModule.EmojiPATCHHandler(ctx)
@@ -284,7 +285,7 @@ func (suite *EmojiUpdateTestSuite) TestEmojiUpdateDisableEmoji() {
bodyBytes := requestBody.Bytes()
recorder := httptest.NewRecorder()
ctx := suite.newContext(recorder, http.MethodPost, bodyBytes, admin.EmojiPathWithID, w.FormDataContentType())
- ctx.AddParam(admin.IDKey, testEmoji.ID)
+ ctx.AddParam(apiutil.IDKey, testEmoji.ID)
// call the handler
suite.adminModule.EmojiPATCHHandler(ctx)
@@ -325,7 +326,7 @@ func (suite *EmojiUpdateTestSuite) TestEmojiUpdateDisableLocalEmoji() {
bodyBytes := requestBody.Bytes()
recorder := httptest.NewRecorder()
ctx := suite.newContext(recorder, http.MethodPost, bodyBytes, admin.EmojiPathWithID, w.FormDataContentType())
- ctx.AddParam(admin.IDKey, testEmoji.ID)
+ ctx.AddParam(apiutil.IDKey, testEmoji.ID)
// call the handler
suite.adminModule.EmojiPATCHHandler(ctx)
@@ -358,7 +359,7 @@ func (suite *EmojiUpdateTestSuite) TestEmojiUpdateModifyRemoteEmoji() {
bodyBytes := requestBody.Bytes()
recorder := httptest.NewRecorder()
ctx := suite.newContext(recorder, http.MethodPost, bodyBytes, admin.EmojiPathWithID, w.FormDataContentType())
- ctx.AddParam(admin.IDKey, testEmoji.ID)
+ ctx.AddParam(apiutil.IDKey, testEmoji.ID)
// call the handler
suite.adminModule.EmojiPATCHHandler(ctx)
@@ -391,7 +392,7 @@ func (suite *EmojiUpdateTestSuite) TestEmojiUpdateModifyNoParams() {
bodyBytes := requestBody.Bytes()
recorder := httptest.NewRecorder()
ctx := suite.newContext(recorder, http.MethodPost, bodyBytes, admin.EmojiPathWithID, w.FormDataContentType())
- ctx.AddParam(admin.IDKey, testEmoji.ID)
+ ctx.AddParam(apiutil.IDKey, testEmoji.ID)
// call the handler
suite.adminModule.EmojiPATCHHandler(ctx)
@@ -425,7 +426,7 @@ func (suite *EmojiUpdateTestSuite) TestEmojiUpdateCopyLocalToLocal() {
bodyBytes := requestBody.Bytes()
recorder := httptest.NewRecorder()
ctx := suite.newContext(recorder, http.MethodPost, bodyBytes, admin.EmojiPathWithID, w.FormDataContentType())
- ctx.AddParam(admin.IDKey, testEmoji.ID)
+ ctx.AddParam(apiutil.IDKey, testEmoji.ID)
// call the handler
suite.adminModule.EmojiPATCHHandler(ctx)
@@ -459,7 +460,7 @@ func (suite *EmojiUpdateTestSuite) TestEmojiUpdateCopyEmptyShortcode() {
bodyBytes := requestBody.Bytes()
recorder := httptest.NewRecorder()
ctx := suite.newContext(recorder, http.MethodPost, bodyBytes, admin.EmojiPathWithID, w.FormDataContentType())
- ctx.AddParam(admin.IDKey, testEmoji.ID)
+ ctx.AddParam(apiutil.IDKey, testEmoji.ID)
// call the handler
suite.adminModule.EmojiPATCHHandler(ctx)
@@ -492,7 +493,7 @@ func (suite *EmojiUpdateTestSuite) TestEmojiUpdateCopyNoShortcode() {
bodyBytes := requestBody.Bytes()
recorder := httptest.NewRecorder()
ctx := suite.newContext(recorder, http.MethodPost, bodyBytes, admin.EmojiPathWithID, w.FormDataContentType())
- ctx.AddParam(admin.IDKey, testEmoji.ID)
+ ctx.AddParam(apiutil.IDKey, testEmoji.ID)
// call the handler
suite.adminModule.EmojiPATCHHandler(ctx)
@@ -526,7 +527,7 @@ func (suite *EmojiUpdateTestSuite) TestEmojiUpdateCopyShortcodeAlreadyInUse() {
bodyBytes := requestBody.Bytes()
recorder := httptest.NewRecorder()
ctx := suite.newContext(recorder, http.MethodPost, bodyBytes, admin.EmojiPathWithID, w.FormDataContentType())
- ctx.AddParam(admin.IDKey, testEmoji.ID)
+ ctx.AddParam(apiutil.IDKey, testEmoji.ID)
// call the handler
suite.adminModule.EmojiPATCHHandler(ctx)