diff --git a/crates/application/src/services/notification_event.rs b/crates/application/src/services/notification_event.rs index 6747f06..de1f166 100644 --- a/crates/application/src/services/notification_event.rs +++ b/crates/application/src/services/notification_event.rs @@ -214,4 +214,26 @@ mod tests { }).await.unwrap(); assert!(store.notifications.lock().unwrap().is_empty()); } + + #[tokio::test] + async fn self_boost_creates_no_notification() { + let store = TestStore::default(); + let alice = alice(); + let thought = Thought::new_local( + ThoughtId::new(), alice.id.clone(), + Content::new_local("hello").unwrap(), + None, Visibility::Public, None, false, + ); + store.thoughts.lock().unwrap().push(thought.clone()); + let svc = NotificationEventService { + thoughts: Arc::new(store.clone()), + notifications: Arc::new(store.clone()), + }; + svc.process(&DomainEvent::BoostAdded { + boost_id: BoostId::new(), + user_id: alice.id.clone(), + thought_id: thought.id.clone(), + }).await.unwrap(); + assert!(store.notifications.lock().unwrap().is_empty()); + } }