Courrier v1.2 (tt-2026-11-064) : tri du jour du plus recent au plus ancien, repartition par nombre de mails decroissant
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XGaEeWkqZYNP6Wn3mGQsrL
This commit is contained in:
1 parent
71262d927e
commit
cdb78c3e04
3 files changed
+32
-6
No files matched your search
@@ -0,0 +1,26 @@
|
||||
from pathlib import Path
|
||||
|
||||
STATIC = Path(__file__).resolve().parent.parent / "app" / "static"
|
||||
|
||||
|
||||
def _js():
|
||||
return (STATIC / "app.js").read_text(encoding="utf-8")
|
||||
|
||||
|
||||
def test_tri_du_jour_du_plus_recent_au_plus_ancien():
|
||||
"""Les mails du jour sont triés par date décroissante (b comparé à a)."""
|
||||
js = _js()
|
||||
assert "S.mails = (r.mails || []).map(normaliser).sort(function (a, b) { return String(b.date).localeCompare(String(a.date)); });" in js
|
||||
assert "String(a.date).localeCompare(String(b.date))" not in js
|
||||
|
||||
|
||||
def test_repartition_du_jour_par_nombre_de_mails_decroissant():
|
||||
"""Tous reste en tête, puis catégories par nombre de mails décroissant, égalité = ordre d'origine."""
|
||||
js = _js()
|
||||
assert "return y.n - x.n || x.rang - y.rang;" in js
|
||||
assert js.index("nom: 'Tous'") < js.index("y.n - x.n")
|
||||
|
||||
|
||||
def test_groupes_categories_meme_classement():
|
||||
js = _js()
|
||||
assert "(cc[y.c.nom] || 0) - (cc[x.c.nom] || 0) || x.rang - y.rang" in js
|
||||
Reference in new issue
Block a user