Release Please / Release Please (push) Skipped
Tests / Test (Go 1.22) (push) Skipped
Tests / Test (Go stable) (push) Skipped
Release / GoReleaser (push) Failing after 38s
Polish the office TUI with proportional pane layout, drag resize, live filtering, HTML mail preview, paginated mail lists, overflow scrollbars, flattened navigation, and project save/status fixes; add UpdateProjectStatus. Co-authored-by: Cursor <cursoragent@cursor.com>
38 lines
920 B
Go
38 lines
920 B
Go
package model
|
|
|
|
import "testing"
|
|
|
|
func TestClassifyCalendarRow(t *testing.T) {
|
|
kind, label := ClassifyCalendarRow(map[string]any{
|
|
"title": "Standup",
|
|
"start": "2026-06-24T10:00:00Z",
|
|
})
|
|
if kind != KindEvent || label != "Event" {
|
|
t.Fatalf("got kind=%s label=%q", kind, label)
|
|
}
|
|
kind, label = ClassifyCalendarRow(map[string]any{"title": "Work"})
|
|
if kind != KindCalendar || label != "Calendar" {
|
|
t.Fatalf("got kind=%s label=%q", kind, label)
|
|
}
|
|
}
|
|
|
|
func TestBuildCalendarColumnsIncludesType(t *testing.T) {
|
|
items := []Item{{
|
|
ID: "1", Title: "Meet", Kind: KindEvent,
|
|
Raw: map[string]any{"type": "Event", "start": "2026-06-24T10:00:00Z"},
|
|
}}
|
|
cols := BuildColumns(SubjectCalendar, items)
|
|
found := false
|
|
for _, c := range cols {
|
|
if c.Key == "type" {
|
|
found = true
|
|
}
|
|
if c.Key == "subtitle" {
|
|
t.Fatal("subtitle column should not appear")
|
|
}
|
|
}
|
|
if !found {
|
|
t.Fatal("expected type column")
|
|
}
|
|
}
|