diff options
Diffstat (limited to 'internal/api')
| -rw-r--r-- | internal/api/activitypub/users/inboxpost_test.go | 9 | ||||
| -rw-r--r-- | internal/api/client/admin/reportsget_test.go | 52 | ||||
| -rw-r--r-- | internal/api/model/field.go | 2 | 
3 files changed, 54 insertions, 9 deletions
| diff --git a/internal/api/activitypub/users/inboxpost_test.go b/internal/api/activitypub/users/inboxpost_test.go index 129563532..26c4029a2 100644 --- a/internal/api/activitypub/users/inboxpost_test.go +++ b/internal/api/activitypub/users/inboxpost_test.go @@ -32,6 +32,7 @@ import (  	"github.com/superseriousbusiness/activity/pub"  	"github.com/superseriousbusiness/activity/streams"  	"github.com/superseriousbusiness/activity/streams/vocab" +	"github.com/superseriousbusiness/gotosocial/internal/ap"  	"github.com/superseriousbusiness/gotosocial/internal/api/activitypub/users"  	"github.com/superseriousbusiness/gotosocial/internal/db"  	"github.com/superseriousbusiness/gotosocial/internal/gtsmodel" @@ -76,7 +77,7 @@ func (suite *InboxPostTestSuite) TestPostBlock() {  	targetURI := testrig.URLMustParse(blockedAccount.InboxURI)  	signature, digestHeader, dateHeader := testrig.GetSignatureForActivity(block, blockingAccount.PublicKeyURI, blockingAccount.PrivateKey, targetURI) -	bodyI, err := streams.Serialize(block) +	bodyI, err := ap.Serialize(block)  	suite.NoError(err)  	bodyJson, err := json.Marshal(bodyI) @@ -177,7 +178,7 @@ func (suite *InboxPostTestSuite) TestPostUnblock() {  	targetURI := testrig.URLMustParse(blockedAccount.InboxURI)  	signature, digestHeader, dateHeader := testrig.GetSignatureForActivity(undo, blockingAccount.PublicKeyURI, blockingAccount.PrivateKey, targetURI) -	bodyI, err := streams.Serialize(undo) +	bodyI, err := ap.Serialize(undo)  	suite.NoError(err)  	bodyJson, err := json.Marshal(bodyI) @@ -275,7 +276,7 @@ func (suite *InboxPostTestSuite) TestPostUpdate() {  	targetURI := testrig.URLMustParse(receivingAccount.InboxURI)  	signature, digestHeader, dateHeader := testrig.GetSignatureForActivity(update, updatedAccount.PublicKeyURI, updatedAccount.PrivateKey, targetURI) -	bodyI, err := streams.Serialize(update) +	bodyI, err := ap.Serialize(update)  	suite.NoError(err)  	bodyJson, err := json.Marshal(bodyI) @@ -412,7 +413,7 @@ func (suite *InboxPostTestSuite) TestPostDelete() {  	targetURI := testrig.URLMustParse(receivingAccount.InboxURI)  	signature, digestHeader, dateHeader := testrig.GetSignatureForActivity(delete, deletedAccount.PublicKeyURI, deletedAccount.PrivateKey, targetURI) -	bodyI, err := streams.Serialize(delete) +	bodyI, err := ap.Serialize(delete)  	suite.NoError(err)  	bodyJson, err := json.Marshal(bodyI) diff --git a/internal/api/client/admin/reportsget_test.go b/internal/api/client/admin/reportsget_test.go index 67e6103ae..fae21dc07 100644 --- a/internal/api/client/admin/reportsget_test.go +++ b/internal/api/client/admin/reportsget_test.go @@ -224,7 +224,18 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() {          "statuses_count": 7,          "last_status_at": "2021-10-20T10:40:37.000Z",          "emojis": [], -        "fields": [], +        "fields": [ +          { +            "name": "should you follow me?", +            "value": "maybe!", +            "verified_at": null +          }, +          { +            "name": "age", +            "value": "120", +            "verified_at": null +          } +        ],          "role": {            "name": "user"          } @@ -374,7 +385,18 @@ func (suite *ReportsGetTestSuite) TestReportsGetAll() {          "statuses_count": 7,          "last_status_at": "2021-10-20T10:40:37.000Z",          "emojis": [], -        "fields": [], +        "fields": [ +          { +            "name": "should you follow me?", +            "value": "maybe!", +            "verified_at": null +          }, +          { +            "name": "age", +            "value": "120", +            "verified_at": null +          } +        ],          "role": {            "name": "user"          } @@ -575,7 +597,18 @@ func (suite *ReportsGetTestSuite) TestReportsGetCreatedByAccount() {          "statuses_count": 7,          "last_status_at": "2021-10-20T10:40:37.000Z",          "emojis": [], -        "fields": [], +        "fields": [ +          { +            "name": "should you follow me?", +            "value": "maybe!", +            "verified_at": null +          }, +          { +            "name": "age", +            "value": "120", +            "verified_at": null +          } +        ],          "role": {            "name": "user"          } @@ -776,7 +809,18 @@ func (suite *ReportsGetTestSuite) TestReportsGetTargetAccount() {          "statuses_count": 7,          "last_status_at": "2021-10-20T10:40:37.000Z",          "emojis": [], -        "fields": [], +        "fields": [ +          { +            "name": "should you follow me?", +            "value": "maybe!", +            "verified_at": null +          }, +          { +            "name": "age", +            "value": "120", +            "verified_at": null +          } +        ],          "role": {            "name": "user"          } diff --git a/internal/api/model/field.go b/internal/api/model/field.go index 399fef20a..c3dc8d67a 100644 --- a/internal/api/model/field.go +++ b/internal/api/model/field.go @@ -29,5 +29,5 @@ type Field struct {  	Value string `json:"value"`  	// If this field has been verified, when did this occur? (ISO 8601 Datetime).  	// example: 2021-07-30T09:20:25+00:00 -	VerifiedAt string `json:"verified_at,omitempty"` +	VerifiedAt *string `json:"verified_at"`  } | 
