feat(domain): FederationActionPort trait + avatar_url on RemoteActor

This commit is contained in:
2026-05-14 19:55:10 +02:00
parent 8eb59bfac6
commit 82f8772104
6 changed files with 54 additions and 1 deletions

View File

@@ -534,6 +534,21 @@ impl RemoteActorRepository for TestStore {
}
}
#[async_trait]
impl FederationActionPort for TestStore {
async fn lookup_actor(&self, _handle: &str) -> Result<RemoteActor, DomainError> {
Err(DomainError::NotFound)
}
async fn follow_remote(
&self,
_local_user_id: &UserId,
_handle: &str,
) -> Result<(), DomainError> {
Ok(())
}
}
#[async_trait]
impl FeedRepository for TestStore {
async fn home_feed(
@@ -767,6 +782,32 @@ mod ap_repo_tests {
}
}
#[cfg(test)]
mod federation_port_tests {
use super::*;
use crate::value_objects::UserId;
fn uid() -> UserId {
UserId::new()
}
#[tokio::test]
async fn test_store_lookup_returns_not_found() {
let store = TestStore::default();
let err = store.lookup_actor("@alice@example.com").await.unwrap_err();
assert!(matches!(err, DomainError::NotFound));
}
#[tokio::test]
async fn test_store_follow_remote_is_noop_ok() {
let store = TestStore::default();
store
.follow_remote(&uid(), "@alice@example.com")
.await
.unwrap();
}
}
#[cfg(test)]
mod search_tests {
use super::*;