mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-02 15:38:08 -06:00
[chore] Inboxes for iri test (#508)
* tidy up some federation tests * add missing license to following.go * give zork some followers, as a treat * test InboxesForIRI * Go fmt * update timeline tests
This commit is contained in:
parent
f9b351438b
commit
63f84da3e4
11 changed files with 247 additions and 110 deletions
|
|
@ -41,6 +41,7 @@ type FilterStandardTestSuite struct {
|
|||
testStatuses map[string]*gtsmodel.Status
|
||||
testTags map[string]*gtsmodel.Tag
|
||||
testMentions map[string]*gtsmodel.Mention
|
||||
testFollows map[string]*gtsmodel.Follow
|
||||
|
||||
filter visibility.Filter
|
||||
}
|
||||
|
|
@ -55,6 +56,7 @@ func (suite *FilterStandardTestSuite) SetupSuite() {
|
|||
suite.testStatuses = testrig.NewTestStatuses()
|
||||
suite.testTags = testrig.NewTestTags()
|
||||
suite.testMentions = testrig.NewTestMentions()
|
||||
suite.testFollows = testrig.NewTestFollows()
|
||||
}
|
||||
|
||||
func (suite *FilterStandardTestSuite) SetupTest() {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/suite"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
)
|
||||
|
||||
type StatusVisibleTestSuite struct {
|
||||
|
|
@ -85,6 +86,8 @@ func (suite *StatusVisibleTestSuite) TestDMNotVisibleIfNotMentioned() {
|
|||
func (suite *StatusVisibleTestSuite) TestStatusNotVisibleIfNotMutuals() {
|
||||
ctx := context.Background()
|
||||
|
||||
suite.db.DeleteByID(ctx, suite.testFollows["local_account_2_local_account_1"].ID, >smodel.Follow{})
|
||||
|
||||
testStatusID := suite.testStatuses["local_account_1_status_4"].ID
|
||||
testStatus, err := suite.db.GetStatusByID(ctx, testStatusID)
|
||||
suite.NoError(err)
|
||||
|
|
@ -99,6 +102,8 @@ func (suite *StatusVisibleTestSuite) TestStatusNotVisibleIfNotMutuals() {
|
|||
func (suite *StatusVisibleTestSuite) TestStatusNotVisibleIfNotFollowing() {
|
||||
ctx := context.Background()
|
||||
|
||||
suite.db.DeleteByID(ctx, suite.testFollows["admin_account_local_account_1"].ID, >smodel.Follow{})
|
||||
|
||||
testStatusID := suite.testStatuses["local_account_1_status_5"].ID
|
||||
testStatus, err := suite.db.GetStatusByID(ctx, testStatusID)
|
||||
suite.NoError(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue