cf066bde97
Store: CalendarEvents(ctx, from, to) — filters caldav facts by key date prefix. IPC: full wiring through interface, server dispatch, and client. Router: ParseCalendarDate (сегодня/завтра), CalendarEventFormatter (RU reply). Voice: calendar detection before notes RAG in IntentQuery handler. Tests: store integration test, date parser tests, formatter tests. Co-Authored-By: opencode <opencode@anthropic.com>
27 lines
685 B
Go
27 lines
685 B
Go
package router
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestCalendarEventFormatter(t *testing.T) {
|
|
f := CalendarEventFormatter{}
|
|
date := time.Date(2026, 7, 6, 0, 0, 0, 0, time.UTC)
|
|
|
|
// Empty
|
|
if got := f.Format(nil, date); got != "на 06.07.2026 ничего нет." {
|
|
t.Errorf("empty: got %q", got)
|
|
}
|
|
|
|
// One event
|
|
if got := f.Format([]string{"Standup @ 10:00-10:30"}, date); got != "на 06.07.2026: Standup @ 10:00-10:30" {
|
|
t.Errorf("one: got %q", got)
|
|
}
|
|
|
|
// Multiple events
|
|
if got := f.Format([]string{"Standup @ 10:00-10:30", "Lunch @ 12:00-13:00"}, date); got != "на 06.07.2026: Standup @ 10:00-10:30; Lunch @ 12:00-13:00" {
|
|
t.Errorf("multiple: got %q", got)
|
|
}
|
|
}
|