diff options
author | 2022-04-29 15:05:13 +0200 | |
---|---|---|
committer | 2022-04-29 15:05:13 +0200 | |
commit | 63f84da3e45d4e1cace427c6d30f19ba7e621618 (patch) | |
tree | c99679350b1b3ed64451f894fd485cc3dc9c8b0a /internal/visibility | |
parent | [feature] allow absolute path to templates (#507) (diff) | |
download | gotosocial-63f84da3e45d4e1cace427c6d30f19ba7e621618.tar.xz |
[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
Diffstat (limited to 'internal/visibility')
-rw-r--r-- | internal/visibility/filter_test.go | 2 | ||||
-rw-r--r-- | internal/visibility/statusvisible_test.go | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/internal/visibility/filter_test.go b/internal/visibility/filter_test.go index 5c10a4210..1283a50de 100644 --- a/internal/visibility/filter_test.go +++ b/internal/visibility/filter_test.go @@ -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() { diff --git a/internal/visibility/statusvisible_test.go b/internal/visibility/statusvisible_test.go index e23973b5a..e7f6aa09d 100644 --- a/internal/visibility/statusvisible_test.go +++ b/internal/visibility/statusvisible_test.go @@ -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) |