From 10605bbf2f5ad41f5ac1efd294e7540282283b1c Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Thu, 14 May 2026 13:37:29 +0200 Subject: [PATCH] test(application): add self_boost_creates_no_notification test --- .../src/services/notification_event.rs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) 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()); + } }