Add offline-first task-master TUI with tickets, board lists, and undo.
Charm-based CLI with JSON persistence, status/list filters, external editor editing, command-history undo/redo, and glamour markdown without AutoStyle OSC hangs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package ticket_test
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"task/internal/ticket"
|
||||
)
|
||||
|
||||
func TestFormatAndParseEditDocument(t *testing.T) {
|
||||
doc := ticket.FormatEditDocument(ticket.Ticket{
|
||||
Title: "Fix login",
|
||||
Description: "Steps:\n\n1. repro\n2. patch",
|
||||
})
|
||||
if !strings.HasPrefix(doc, "# Fix login\n") {
|
||||
t.Fatalf("format = %q", doc)
|
||||
}
|
||||
|
||||
title, desc, err := ticket.ParseEditDocument(doc)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if title != "Fix login" {
|
||||
t.Fatalf("title = %q", title)
|
||||
}
|
||||
if desc != "Steps:\n\n1. repro\n2. patch" {
|
||||
t.Fatalf("desc = %q", desc)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseEditDocumentPlainTitle(t *testing.T) {
|
||||
title, desc, err := ticket.ParseEditDocument("Plain title\n\nBody text")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if title != "Plain title" || desc != "Body text" {
|
||||
t.Fatalf("got %q / %q", title, desc)
|
||||
}
|
||||
}
|
||||
|
||||
func TestParseEditDocumentEmpty(t *testing.T) {
|
||||
if _, _, err := ticket.ParseEditDocument(" "); err == nil {
|
||||
t.Fatal("expected error")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user