diff options
author | 2023-01-13 17:02:45 +0100 | |
---|---|---|
committer | 2023-01-13 17:02:45 +0100 | |
commit | eafd73c29204072050591a0579e0cedb174e6d38 (patch) | |
tree | 8cb581647e00f366395d97d27c36c6099e93754b /internal/api/client/admin/emojidelete_test.go | |
parent | [performance] media processing improvements (#1288) (diff) | |
download | gotosocial-eafd73c29204072050591a0579e0cedb174e6d38.tar.xz |
[chore] Remove omitempty on account source; refactor tests to use prettyprint json (#1337)
* remove omitEmpty tag on account source items
* update tests
Diffstat (limited to 'internal/api/client/admin/emojidelete_test.go')
-rw-r--r-- | internal/api/client/admin/emojidelete_test.go | 20 |
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) |