summaryrefslogtreecommitdiff
path: root/internal/typeutils
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-04-06 13:16:53 +0200
committerLibravatar GitHub <noreply@github.com>2023-04-06 12:16:53 +0100
commit4f322f527f6c6e043f9efa13034fed1dbd35f1eb (patch)
tree0ae8f7949ab691827040de5c24b9dd6f84650c5a /internal/typeutils
parent[bugfix] Add proper constraints on status faves, dedupe (#1674) (diff)
downloadgotosocial-4f322f527f6c6e043f9efa13034fed1dbd35f1eb.tar.xz
[bugfix] Always serialize orderedItems as array (#1673)
Diffstat (limited to 'internal/typeutils')
-rw-r--r--internal/typeutils/internaltoas_test.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/internal/typeutils/internaltoas_test.go b/internal/typeutils/internaltoas_test.go
index 9c858947e..486866160 100644
--- a/internal/typeutils/internaltoas_test.go
+++ b/internal/typeutils/internaltoas_test.go
@@ -26,6 +26,7 @@ import (
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/activity/streams"
+ "github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/testrig"
@@ -669,7 +670,7 @@ func (suite *InternalToASTestSuite) TestPinnedStatusesToASSomeItems() {
suite.FailNow(err.Error())
}
- ser, err := streams.Serialize(collection)
+ ser, err := ap.SerializeOrderedCollection(collection)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@@ -701,7 +702,7 @@ func (suite *InternalToASTestSuite) TestPinnedStatusesToASNoItems() {
suite.FailNow(err.Error())
}
- ser, err := streams.Serialize(collection)
+ ser, err := ap.SerializeOrderedCollection(collection)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@@ -730,7 +731,7 @@ func (suite *InternalToASTestSuite) TestPinnedStatusesToASOneItem() {
suite.FailNow(err.Error())
}
- ser, err := streams.Serialize(collection)
+ ser, err := ap.SerializeOrderedCollection(collection)
suite.NoError(err)
bytes, err := json.MarshalIndent(ser, "", " ")
@@ -739,7 +740,9 @@ func (suite *InternalToASTestSuite) TestPinnedStatusesToASOneItem() {
suite.Equal(`{
"@context": "https://www.w3.org/ns/activitystreams",
"id": "http://localhost:8080/users/1happyturtle/collections/featured",
- "orderedItems": "http://localhost:8080/users/1happyturtle/statuses/01G20ZM733MGN8J344T4ZDDFY1",
+ "orderedItems": [
+ "http://localhost:8080/users/1happyturtle/statuses/01G20ZM733MGN8J344T4ZDDFY1"
+ ],
"totalItems": 1,
"type": "OrderedCollection"
}`, string(bytes))