mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-02 04:02:24 -06:00
[feature] Add from: search operator and account_id query param (#2943)
* Add from: search operator * Fix whitespace in Swagger YAML comment * Move query parsing into its own method * Document search * Clarify post search scope
This commit is contained in:
parent
61a8d36255
commit
04bcde08a1
11 changed files with 312 additions and 15 deletions
|
|
@ -107,11 +107,22 @@ func (suite *SearchTestSuite) TestSearchAccountsFossAny() {
|
|||
func (suite *SearchTestSuite) TestSearchStatuses() {
|
||||
testAccount := suite.testAccounts["local_account_1"]
|
||||
|
||||
statuses, err := suite.db.SearchForStatuses(context.Background(), testAccount.ID, "hello", "", "", 10, 0)
|
||||
statuses, err := suite.db.SearchForStatuses(context.Background(), testAccount.ID, "hello", "", "", "", 10, 0)
|
||||
suite.NoError(err)
|
||||
suite.Len(statuses, 1)
|
||||
}
|
||||
|
||||
func (suite *SearchTestSuite) TestSearchStatusesFromAccount() {
|
||||
testAccount := suite.testAccounts["local_account_1"]
|
||||
fromAccount := suite.testAccounts["local_account_2"]
|
||||
|
||||
statuses, err := suite.db.SearchForStatuses(context.Background(), testAccount.ID, "hi", fromAccount.ID, "", "", 10, 0)
|
||||
suite.NoError(err)
|
||||
if suite.Len(statuses, 1) {
|
||||
suite.Equal(fromAccount.ID, statuses[0].AccountID)
|
||||
}
|
||||
}
|
||||
|
||||
func (suite *SearchTestSuite) TestSearchTags() {
|
||||
// Search with full tag string.
|
||||
tags, err := suite.db.SearchForTags(context.Background(), "welcome", "", "", 10, 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue