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:
parent
dc4240e702
commit
2570c3410b
8 changed files with 50 additions and 14 deletions
|
@ -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")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue