1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-31 18:31:01 +00:00

History: show entries in the order in which they were read

Add a changed_at timestamp to the entries table. This field is updated
whenever the entry's metadata changes.
This commit is contained in:
Peter De Wachter 2020-02-11 05:20:03 +01:00 committed by GitHub
parent dc4240e702
commit 2570c3410b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 50 additions and 14 deletions

View file

@ -257,3 +257,29 @@ func TestToggleBookmark(t *testing.T) {
t.Fatal("The entry should be starred")
}
}
func TestHistoryOrder(t *testing.T) {
client := createClient(t)
createFeed(t, client)
result, err := client.Entries(&miniflux.Filter{Limit: 3})
if err != nil {
t.Fatal(err)
}
selectedEntry := result.Entries[2].ID
err = client.UpdateEntries([]int64{selectedEntry}, miniflux.EntryStatusRead)
if err != nil {
t.Fatal(err)
}
history, err := client.Entries(&miniflux.Filter{Order: "changed_at", Direction: "desc", Limit: 1})
if err != nil {
t.Fatal(err)
}
if history.Entries[0].ID != selectedEntry {
t.Fatal("The entry that we just read should be at the top of the history")
}
}