This commit is contained in:
team3
2026-09-19 22:22:51 +02:00
parent 7da689889c
commit e1b532b35c
7 changed files with 70 additions and 17 deletions

View File

@@ -149,6 +149,7 @@ click 'cal._viewButtons.month'
check "Fokusverlust beendet den Editor, Anzeige gerendert" "$(val '[notes._editing, notes._viewScroll.visible, notes._content.text].join("|")')" "false|true|Hallo
Erste Notiz"
check "Notiz mit Überschrift wird nicht abgeschnitten" "$(val '(l => Math.round(l.get_preferred_height(l.width)[1]) >= l.clutter_text.get_layout().get_pixel_size()[1] && l.get_allocation_box().get_height() >= l.clutter_text.get_layout().get_pixel_size()[1])(notes._content)')" "true"
click 'notes._viewScroll'
check "Klick in die Fläche startet den Editor" "$(val '[notes._editing, global.stage.get_key_focus() === notes._editor.clutter_text].join(" ")')" "true true"
type_ " mehr"

View File

@@ -54,6 +54,7 @@ check "Server läuft" "$(curl -s $URL/api/health)" '{"ok":true}'
echo "=== Shell mit Sync starten"
SYNC_URL="$URL" "$DIR/restart.sh" headless >/dev/null
check "Sync aktiv" "$(val 'ext._sync.active')" "true"
check "Ohne Aktivität Ruhetakt 10 s" "$(val 'ext._sync.interval')" "10"
echo "=== Lokal → Server"
"$E" "$PRE store.saveEvent({title: 'Zahnarzt', date: '2026-09-21', start: '09:00', end: '10:00', endDate: null}); store.saveTodo({title: 'Einkaufen', date: null, time: null}); 'ok'" >/dev/null
@@ -61,11 +62,12 @@ sleep 3
check "Termin auf dem Server" "$(api "$URL/api/events" | python3 -c 'import json,sys; print([e["title"] for e in json.load(sys.stdin)])')" "['Zahnarzt']"
check "Todo auf dem Server" "$(api "$URL/api/todos" | python3 -c 'import json,sys; print([t["title"] for t in json.load(sys.stdin)])')" "['Einkaufen']"
check "Stand gemerkt" "$(val 'state().cursor > 0')" "true"
check "Nach eigener Änderung Takt 1 s" "$(val 'ext._sync.interval')" "1"
"$E" "$PRE store.saveTodo({title: 'Sofort', date: null, time: null}); 'ok'" >/dev/null
START=$(date +%s%N)
for i in $(seq 1 40); do api "$URL/api/todos" | grep -q '"Sofort"' && break; sleep 0.1; done
MS=$(( ($(date +%s%N) - START) / 1000000 ))
check "Eigene Änderung ist vor dem nächsten Takt (2 s) auf dem Server" "$([ $MS -lt 1500 ] && echo "schnell" || echo "langsam: ${MS}ms")" "schnell"
check "Eigene Änderung ist sofort auf dem Server" "$([ $MS -lt 1500 ] && echo "schnell" || echo "langsam: ${MS}ms")" "schnell"
"$E" "$PRE store.removeTodo(store.todos.find(t => t.title === 'Sofort').id); 'ok'" >/dev/null
sleep 2
@@ -73,6 +75,16 @@ echo "=== Server → lokal"
push '{"todos": [{"id": "r1", "updated": "2026-09-19T10:00:00.000Z", "title": "Vom Handy", "date": null, "time": null, "done": false}], "notes": [{"id": "Remote/Idee.md", "updated": "2026-09-19T10:00:00.000Z", "content": "# Vom Server"}]}'
sleep 3
check "Todo vom Server in der Liste" "$(val 'store.sortedTodos().map(t => t.title).sort().join(",")')" "Einkaufen,Vom Handy"
"$E" "$PRE ext._sync._lastActivity = GLib.get_monotonic_time() - 70e6; 'ok'" >/dev/null
check "Nach 70 s Ruhe Takt 5 s" "$(val 'ext._sync.interval')" "5"
push '{"todos": [{"id": "r2", "updated": "2026-09-19T10:00:00.000Z", "title": "Weckt auf", "date": null, "time": null, "done": false}]}'
sleep 7
check "Änderung vom Server setzt Takt auf 1 s" "$(val 'store.todos.some(t => t.id === "r2") + " " + ext._sync.interval')" "true 1"
"$E" "$PRE ext._sync._lastActivity = GLib.get_monotonic_time() - 400e6; 'ok'" >/dev/null
check "Nach 5 min Ruhe Takt 10 s" "$(val 'ext._sync.interval')" "10"
# Aufräumen: Test-Todo weg, damit wieder schnell abgeglichen wird
"$E" "$PRE store.removeTodo('r2'); 'ok'" >/dev/null
sleep 2
check "Todo vom Server im Panel" "$(val 'labels(todos).includes("Vom Handy")')" "true"
check "Notiz vom Server als Datei" "$(val 'exists(store.notesDir + "/Remote/Idee.md") + " " + JSON.stringify(read(store.notesDir + "/Remote/Idee.md"))')" 'true "# Vom Server"'
check "Notiz vom Server im Baum" "$(val 'labels(notes).includes("▸ Remote")')" "true"