summaryrefslogtreecommitdiff
path: root/internal/timeline/manager_test.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-02-08 12:17:18 +0100
committerLibravatar tsmethurst <tobi.smethurst@protonmail.com>2022-02-08 12:17:18 +0100
commit4c294a596a9e0524f89b80e1608c3411f4fcf679 (patch)
tree23851533a5f1adb5442fd7c3c034578c34cd3f0d /internal/timeline/manager_test.go
parentupdate outdated comment (diff)
parent[chore] Drone config update (#383) (diff)
downloadgotosocial-4c294a596a9e0524f89b80e1608c3411f4fcf679.tar.xz
Merge branch 'main' into media_refactor
Diffstat (limited to 'internal/timeline/manager_test.go')
-rw-r--r--internal/timeline/manager_test.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/internal/timeline/manager_test.go b/internal/timeline/manager_test.go
index 4e81bfe17..11b5dfb78 100644
--- a/internal/timeline/manager_test.go
+++ b/internal/timeline/manager_test.go
@@ -23,6 +23,9 @@ import (
"testing"
"github.com/stretchr/testify/suite"
+ "github.com/superseriousbusiness/gotosocial/internal/processing"
+ "github.com/superseriousbusiness/gotosocial/internal/timeline"
+ "github.com/superseriousbusiness/gotosocial/internal/visibility"
"github.com/superseriousbusiness/gotosocial/testrig"
)
@@ -41,10 +44,16 @@ func (suite *ManagerTestSuite) SetupTest() {
suite.db = testrig.NewTestDB()
suite.tc = testrig.NewTestTypeConverter(suite.db)
+ suite.filter = visibility.NewFilter(suite.db)
testrig.StandardDBSetup(suite.db, nil)
- manager := testrig.NewTestTimelineManager(suite.db)
+ manager := timeline.NewManager(
+ processing.StatusGrabFunction(suite.db),
+ processing.StatusFilterFunction(suite.db, suite.filter),
+ processing.StatusPrepareFunction(suite.db, suite.tc),
+ processing.StatusSkipInsertFunction(),
+ )
suite.manager = manager
}
@@ -78,12 +87,12 @@ func (suite *ManagerTestSuite) TestManagerIntegration() {
suite.Equal("01F8MH75CBF9JFX4ZAD54N0W0R", oldestIndexed)
// get hometimeline
- statuses, err := suite.manager.HomeTimeline(context.Background(), testAccount.ID, "", "", "", 20, false)
+ statuses, err := suite.manager.GetTimeline(context.Background(), testAccount.ID, "", "", "", 20, false)
suite.NoError(err)
suite.Len(statuses, 14)
// now wipe the last status from all timelines, as though it had been deleted by the owner
- err = suite.manager.WipeStatusFromAllTimelines(context.Background(), "01F8MH75CBF9JFX4ZAD54N0W0R")
+ err = suite.manager.WipeItemFromAllTimelines(context.Background(), "01F8MH75CBF9JFX4ZAD54N0W0R")
suite.NoError(err)
// timeline should be shorter
@@ -110,7 +119,7 @@ func (suite *ManagerTestSuite) TestManagerIntegration() {
suite.Equal("01F8MHAAY43M6RJ473VQFCVH37", oldestIndexed)
// now remove all entries by local_account_2 from the timeline
- err = suite.manager.WipeStatusesFromAccountID(context.Background(), testAccount.ID, suite.testAccounts["local_account_2"].ID)
+ err = suite.manager.WipeItemsFromAccountID(context.Background(), testAccount.ID, suite.testAccounts["local_account_2"].ID)
suite.NoError(err)
// timeline should be shorter