summaryrefslogtreecommitdiff
path: root/internal/typeutils/wrap_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-07-26 12:04:28 +0200
committerLibravatar GitHub <noreply@github.com>2024-07-26 12:04:28 +0200
commit8ab2b19a946251f258446d22f420d401f61d22f6 (patch)
tree39fb674f135fd1cfcf4de5b319913f0d0c17d11a /internal/typeutils/wrap_test.go
parent[docs] Add separate migration section + instructions for moving to GtS and no... (diff)
downloadgotosocial-8ab2b19a946251f258446d22f420d401f61d22f6.tar.xz
[feature] Federate interaction policies + Accepts; enforce policies (#3138)
* [feature] Federate interaction policies + Accepts; enforce policies * use Acceptable type * fix index * remove appendIRIStrs * add GetAccept federatingdb function * lock on object IRI
Diffstat (limited to 'internal/typeutils/wrap_test.go')
-rw-r--r--internal/typeutils/wrap_test.go25
1 files changed, 24 insertions, 1 deletions
diff --git a/internal/typeutils/wrap_test.go b/internal/typeutils/wrap_test.go
index 453073ed6..833b18bac 100644
--- a/internal/typeutils/wrap_test.go
+++ b/internal/typeutils/wrap_test.go
@@ -72,11 +72,14 @@ func (suite *WrapTestSuite) TestWrapNoteInCreate() {
createI, err := ap.Serialize(create)
suite.NoError(err)
+ // Chop off @context since
+ // ordering is non-determinate.
+ delete(createI, "@context")
+
bytes, err := json.MarshalIndent(createI, "", " ")
suite.NoError(err)
suite.Equal(`{
- "@context": "https://www.w3.org/ns/activitystreams",
"actor": "http://localhost:8080/users/the_mighty_zork",
"cc": "http://localhost:8080/users/the_mighty_zork/followers",
"id": "http://localhost:8080/users/the_mighty_zork/statuses/01F8MHAMCHF6Y650WCRSCP4WMY/activity#Create",
@@ -89,6 +92,26 @@ func (suite *WrapTestSuite) TestWrapNoteInCreate() {
"en": "hello everyone!"
},
"id": "http://localhost:8080/users/the_mighty_zork/statuses/01F8MHAMCHF6Y650WCRSCP4WMY",
+ "interactionPolicy": {
+ "canAnnounce": {
+ "always": [
+ "https://www.w3.org/ns/activitystreams#Public"
+ ],
+ "approvalRequired": []
+ },
+ "canLike": {
+ "always": [
+ "https://www.w3.org/ns/activitystreams#Public"
+ ],
+ "approvalRequired": []
+ },
+ "canReply": {
+ "always": [
+ "https://www.w3.org/ns/activitystreams#Public"
+ ],
+ "approvalRequired": []
+ }
+ },
"published": "2021-10-20T12:40:37+02:00",
"replies": {
"first": {