mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore] Remove omitempty on account source; refactor tests to use prettyprint json (#1337)
* remove omitEmpty tag on account source items * update tests
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user