summaryrefslogtreecommitdiff
path: root/internal/api/client/admin/emojidelete_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/client/admin/emojidelete_test.go')
-rw-r--r--internal/api/client/admin/emojidelete_test.go20
1 files changed, 18 insertions, 2 deletions
diff --git a/internal/api/client/admin/emojidelete_test.go b/internal/api/client/admin/emojidelete_test.go
index e9eaa464c..e7e4a153b 100644
--- a/internal/api/client/admin/emojidelete_test.go
+++ b/internal/api/client/admin/emojidelete_test.go
@@ -19,7 +19,9 @@
package admin_test
import (
+ "bytes"
"context"
+ "encoding/json"
"io"
"net/http"
"net/http/httptest"
@@ -48,8 +50,22 @@ func (suite *EmojiDeleteTestSuite) TestEmojiDelete1() {
b, err := io.ReadAll(recorder.Body)
suite.NoError(err)
suite.NotNil(b)
-
- suite.Equal(`{"shortcode":"rainbow","url":"http://localhost:8080/fileserver/01AY6P665V14JJR0AFVRT7311Y/emoji/original/01F8MH9H8E4VG3KDYJR9EGPXCQ.png","static_url":"http://localhost:8080/fileserver/01AY6P665V14JJR0AFVRT7311Y/emoji/static/01F8MH9H8E4VG3KDYJR9EGPXCQ.png","visible_in_picker":true,"category":"reactions","id":"01F8MH9H8E4VG3KDYJR9EGPXCQ","disabled":false,"updated_at":"2021-09-20T10:40:37.000Z","total_file_size":47115,"content_type":"image/png","uri":"http://localhost:8080/emoji/01F8MH9H8E4VG3KDYJR9EGPXCQ"}`, string(b))
+ dst := new(bytes.Buffer)
+ err = json.Indent(dst, b, "", " ")
+ suite.NoError(err)
+ suite.Equal(`{
+ "shortcode": "rainbow",
+ "url": "http://localhost:8080/fileserver/01AY6P665V14JJR0AFVRT7311Y/emoji/original/01F8MH9H8E4VG3KDYJR9EGPXCQ.png",
+ "static_url": "http://localhost:8080/fileserver/01AY6P665V14JJR0AFVRT7311Y/emoji/static/01F8MH9H8E4VG3KDYJR9EGPXCQ.png",
+ "visible_in_picker": true,
+ "category": "reactions",
+ "id": "01F8MH9H8E4VG3KDYJR9EGPXCQ",
+ "disabled": false,
+ "updated_at": "2021-09-20T10:40:37.000Z",
+ "total_file_size": 47115,
+ "content_type": "image/png",
+ "uri": "http://localhost:8080/emoji/01F8MH9H8E4VG3KDYJR9EGPXCQ"
+}`, dst.String())
// emoji should no longer be in the db
dbEmoji, err := suite.db.GetEmojiByID(context.Background(), testEmoji.ID)