tiki/controller/testing.go

37 lines
788 B
Go
Raw Normal View History

2026-01-17 16:08:53 +00:00
package controller
import (
"github.com/boolean-maybe/tiki/task"
)
// Test utilities for controller unit tests
// newMockNavigationController creates a new mock navigation controller
func newMockNavigationController() *NavigationController {
return &NavigationController{
2026-03-20 17:02:53 +00:00
app: nil, // unit tests don't need the tview.Application
navState: newViewStack(),
2026-01-17 16:08:53 +00:00
}
}
// Test fixtures
// newTestTask creates a test task with default values
func newTestTask() *task.Task {
return &task.Task{
2026-01-21 21:16:54 +00:00
ID: "TIKI-1",
2026-01-17 16:08:53 +00:00
Title: "Test Task",
Status: task.StatusReady,
2026-01-17 16:08:53 +00:00
Type: task.TypeStory,
Priority: 3,
Points: 5,
}
}
// newTestTaskWithID creates a test task with ID "DRAFT-1"
func newTestTaskWithID() *task.Task {
t := newTestTask()
t.ID = "DRAFT-1"
return t
}