feat: Inline-Bearbeiten fuer Fixposten, Einmalposten, Kredite und Szenario-Kopf

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-20 11:42:04 +02:00
parent cbcf2e0439
commit aa1884c31e
2 changed files with 106 additions and 5 deletions

View File

@@ -2,7 +2,7 @@ from datetime import date, timedelta
from decimal import Decimal
from app.formats import eur
from app.models.tables import Account, RecurringItem
from app.models.tables import Account, Loan, PlannedItem, RecurringItem, Scenario
H = {"Authorization": "Bearer test-key"}
@@ -309,6 +309,22 @@ def test_salden_stichtag_garbage_falls_back_to_today(client):
assert date.today().strftime('%d.%m.%Y') in r.text
def test_planung_hat_bearbeiten_formulare(client, db):
client.post("/login", data={"username": "admin", "password": "geheim"})
db.add(RecurringItem(name="EditR", amount=Decimal("-5.00"), rhythm="monthly", due_day=1))
db.add(PlannedItem(name="EditP", amount=Decimal("-7.00"), due=date(2026, 8, 1)))
db.add(Loan(name="EditL", principal=Decimal("1000.00"),
annual_rate_pct=Decimal("4.50"), term_months=12,
payout_date=date(2026, 8, 1), repayment_type="annuity"))
db.add(Scenario(name="EditS", description="d"))
db.commit()
r = client.get("/planung").text
assert r.count(">Bearbeiten</button>") >= 4
for fragment in ('hx-patch="/api/recurring/', 'hx-patch="/api/planned/',
'hx-patch="/api/loans/', 'hx-patch="/api/scenarios/'):
assert fragment in r, fragment
def test_salden_shows_ohne_anker_footnote(client, db):
# UX-Regel: Konten ohne Anker sind immer sichtbar als relative Werte
# gekennzeichnet, nicht stillschweigend wie geankerte Konten dargestellt.