summaryrefslogtreecommitdiff
path: root/internal/handlers/atoms_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/handlers/atoms_test.go')
-rw-r--r--internal/handlers/atoms_test.go30
1 files changed, 29 insertions, 1 deletions
diff --git a/internal/handlers/atoms_test.go b/internal/handlers/atoms_test.go
index 3be82f8..521b147 100644
--- a/internal/handlers/atoms_test.go
+++ b/internal/handlers/atoms_test.go
@@ -16,8 +16,36 @@ func (m *mockClaudomatorClient) GetActiveStories(ctx context.Context) ([]models.
return m.stories, nil
}
+func TestBuildUnifiedAtomList_WithNativeTasks(t *testing.T) {
+ s, err := store.New(":memory:", "../../migrations")
+ if err != nil {
+ t.Fatalf("failed to create in-memory store: %v", err)
+ }
+ defer s.Close()
+
+ if err := s.CreateNativeTask(models.Task{ID: "native-1", Content: "Buy milk"}); err != nil {
+ t.Fatalf("failed to create native task: %v", err)
+ }
+
+ atoms, _, err := BuildUnifiedAtomList(s, nil)
+ if err != nil {
+ t.Fatalf("unexpected error: %v", err)
+ }
+
+ found := false
+ for _, a := range atoms {
+ if a.Source == "doot" && a.Title == "Buy milk" {
+ found = true
+ break
+ }
+ }
+ if !found {
+ t.Errorf("expected atom with Source='doot' and Title='Buy milk'; got atoms: %+v", atoms)
+ }
+}
+
func TestBuildUnifiedAtomList_WithClaudomator(t *testing.T) {
- s, err := store.New(":memory:", "../store/migrations")
+ s, err := store.New(":memory:", "../../migrations")
if err != nil {
t.Fatalf("failed to create in-memory store: %v", err)
}