fix(notify): daily summary includes lists shared through a group
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a69bcbaf10
commit
6b3c32a370
2 files changed
+38
-3
No files matched your search
@@ -158,3 +158,33 @@ func TestDailySummary(t *testing.T) {
|
||||
t.Fatal("only one summary per day")
|
||||
}
|
||||
}
|
||||
|
||||
func TestDailySummaryIncludesGroupSharedLists(t *testing.T) {
|
||||
srv, sent := notifyServer(t)
|
||||
store := srv.store
|
||||
owner, _ := newTestUser(t, store, "chef@example.com")
|
||||
me, _ := newTestUser(t, store, "team@example.com")
|
||||
team, err := store.CreateTeam("", "Arbeit", "")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
for _, uid := range []string{owner.ID, me.ID} { // the owner must see the group to share with it
|
||||
if err := store.AddTeamMember(team.ID, uid, "member"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
}
|
||||
list, _ := store.CreateTaskList(owner.ID, "", "", "Projekt", "📋", "#000000")
|
||||
if _, err := store.AddTaskListShare(list.ID, "team", team.ID, "editor", owner.ID); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
th, _ := store.CreateThoughtWithDetails(owner.ID, "Bericht abgeben", "normal", "manual", "2026-10-30T10:00", list.ID, "todo", "")
|
||||
_, _ = store.UpdateThoughtTriage(owner.ID, th.ID, "keep", "task", "", "2026-10-30T10:00", list.ID)
|
||||
|
||||
set := store.NotificationSettingsOf(me.ID)
|
||||
set.DailySummary = domain.DailySummary{Enabled: true, Time: "07:00", Email: true}
|
||||
_ = store.SetNotificationSettings(me.ID, set)
|
||||
srv.sendDailySummaries(time.Date(2026, 10, 30, 7, 1, 0, 0, time.Local))
|
||||
if len(*sent) != 1 || !strings.Contains((*sent)[0].text, "Bericht abgeben (Projekt)") {
|
||||
t.Fatalf("group-shared task missing: %+v", *sent)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user