Affiche les 20 dernières entrées sur la page d'accueil
Ajoute une carte « Dernières entrées » sous « Aujourd'hui », rafraîchie via htmx sur entries-changed (route /ui/recent). Closes #1 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
dd6a740645
commit
8488b9217d
5 files changed
+87
No files matched your search
@@ -444,6 +444,32 @@ async fn html_pages() {
|
||||
get_html(&app, "/reports?from=2026-03-01&to=2026-03-31&group_by=day").await;
|
||||
assert_eq!(status, StatusCode::OK);
|
||||
assert!(html.contains("1:15") && html.contains("mar. 10/03/2026"));
|
||||
|
||||
let (status, html) = get_html(&app, "/").await;
|
||||
assert_eq!(status, StatusCode::OK);
|
||||
assert!(html.contains("Dernières entrées") && html.contains("mar. 10/03/2026"));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn dashboard_lists_20_most_recent_entries() {
|
||||
let app = app().await;
|
||||
let p = project(&app, "Acme", "Site web").await;
|
||||
for day in 1..=25 {
|
||||
let (status, _) = add_entry(
|
||||
&app,
|
||||
p,
|
||||
local(2026, 3, day, 9, 0),
|
||||
local(2026, 3, day, 10, 0),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(status, StatusCode::CREATED);
|
||||
}
|
||||
|
||||
let (status, html) = get_html(&app, "/ui/recent").await;
|
||||
assert_eq!(status, StatusCode::OK);
|
||||
assert_eq!(html.matches("<tr").count(), 20);
|
||||
assert!(html.contains("25/03/2026") && html.contains("06/03/2026"));
|
||||
assert!(!html.contains("05/03/2026"));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
|
||||
Reference in new issue
Block a user