mirror of
https://github.com/miniflux/v2.git
synced 2025-08-06 17:41:00 +00:00
Add integration test for search query
This commit is contained in:
parent
ca30800e6a
commit
364198ba4a
4 changed files with 32 additions and 1 deletions
|
@ -1091,6 +1091,32 @@ func TestGetAllEntries(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestSearchEntries(t *testing.T) {
|
||||
client := createClient(t)
|
||||
categories, err := client.Categories()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
feedID, err := client.CreateFeed("https://github.com/miniflux/miniflux/releases.atom", categories[0].ID)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if feedID == 0 {
|
||||
t.Fatalf(`Invalid feed ID, got %q`, feedID)
|
||||
}
|
||||
|
||||
results, err := client.Entries(&miniflux.Filter{Search: "2.0.8"})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if results.Total != 1 {
|
||||
t.Fatalf(`We should have only one entry instead of %d`, results.Total)
|
||||
}
|
||||
}
|
||||
|
||||
func TestInvalidFilters(t *testing.T) {
|
||||
client := createClient(t)
|
||||
createFeed(t, client)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue