summaryrefslogtreecommitdiff
path: root/internal/handlers/atoms_test.go
diff options
context:
space:
mode:
authorClaude Agent <agent@doot.local>2026-03-25 05:17:35 +0000
committerClaude Agent <agent@doot.local>2026-03-25 05:17:35 +0000
commitb58787cfec0bd07abc316c66dc9be6c10b8113c6 (patch)
treee1c788094f51bdab0bce8ad38c8d6638c9079bb9 /internal/handlers/atoms_test.go
parent2db5020047640361066510f29f908ca9fd1c99aa (diff)
feat: add Claudomator stories as atom source in Doot tasks tab
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/handlers/atoms_test.go')
-rw-r--r--internal/handlers/atoms_test.go47
1 files changed, 47 insertions, 0 deletions
diff --git a/internal/handlers/atoms_test.go b/internal/handlers/atoms_test.go
new file mode 100644
index 0000000..3be82f8
--- /dev/null
+++ b/internal/handlers/atoms_test.go
@@ -0,0 +1,47 @@
+package handlers
+
+import (
+ "context"
+ "testing"
+
+ "task-dashboard/internal/models"
+ "task-dashboard/internal/store"
+)
+
+type mockClaudomatorClient struct {
+ stories []models.ClaudomatorStory
+}
+
+func (m *mockClaudomatorClient) GetActiveStories(ctx context.Context) ([]models.ClaudomatorStory, error) {
+ return m.stories, nil
+}
+
+func TestBuildUnifiedAtomList_WithClaudomator(t *testing.T) {
+ s, err := store.New(":memory:", "../store/migrations")
+ if err != nil {
+ t.Fatalf("failed to create in-memory store: %v", err)
+ }
+ defer s.Close()
+
+ mock := &mockClaudomatorClient{
+ stories: []models.ClaudomatorStory{
+ {ID: "s1", Title: "My story", Status: "IN_PROGRESS", ProjectID: "nav"},
+ },
+ }
+
+ atoms, _, err := BuildUnifiedAtomList(s, mock)
+ if err != nil {
+ t.Fatalf("unexpected error: %v", err)
+ }
+
+ found := false
+ for _, a := range atoms {
+ if a.Source == "claudomator" && a.Title == "My story" {
+ found = true
+ break
+ }
+ }
+ if !found {
+ t.Error("expected atom with Source='claudomator' and Title='My story'")
+ }
+}