test(application): add self_boost_creates_no_notification test
This commit is contained in:
@@ -214,4 +214,26 @@ mod tests {
|
|||||||
}).await.unwrap();
|
}).await.unwrap();
|
||||||
assert!(store.notifications.lock().unwrap().is_empty());
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user