summaryrefslogtreecommitdiff
path: root/internal/api/client/admin/emojicategoriesget_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-01-13 17:02:45 +0100
committerLibravatar GitHub <noreply@github.com>2023-01-13 17:02:45 +0100
commiteafd73c29204072050591a0579e0cedb174e6d38 (patch)
tree8cb581647e00f366395d97d27c36c6099e93754b /internal/api/client/admin/emojicategoriesget_test.go
parent[performance] media processing improvements (#1288) (diff)
downloadgotosocial-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/emojicategoriesget_test.go')
-rw-r--r--internal/api/client/admin/emojicategoriesget_test.go17
1 files changed, 15 insertions, 2 deletions
diff --git a/internal/api/client/admin/emojicategoriesget_test.go b/internal/api/client/admin/emojicategoriesget_test.go
index 3c7e8eb3d..c9deca1dd 100644
--- a/internal/api/client/admin/emojicategoriesget_test.go
+++ b/internal/api/client/admin/emojicategoriesget_test.go
@@ -19,6 +19,8 @@
package admin_test
import (
+ "bytes"
+ "encoding/json"
"io"
"net/http"
"net/http/httptest"
@@ -44,8 +46,19 @@ func (suite *EmojiCategoriesGetTestSuite) TestEmojiCategoriesGet() {
b, err := io.ReadAll(recorder.Body)
suite.NoError(err)
suite.NotNil(b)
-
- suite.Equal(`[{"id":"01GGQ989PTT9PMRN4FZ1WWK2B9","name":"cute stuff"},{"id":"01GGQ8V4993XK67B2JB396YFB7","name":"reactions"}]`, string(b))
+ dst := new(bytes.Buffer)
+ err = json.Indent(dst, b, "", " ")
+ suite.NoError(err)
+ suite.Equal(`[
+ {
+ "id": "01GGQ989PTT9PMRN4FZ1WWK2B9",
+ "name": "cute stuff"
+ },
+ {
+ "id": "01GGQ8V4993XK67B2JB396YFB7",
+ "name": "reactions"
+ }
+]`, dst.String())
}
func TestEmojiCategoriesGetTestSuite(t *testing.T) {