code refactor
Some checks failed
CI / Check / Test (push) Has been cancelled

Reviewed-on: #26
This commit was merged in pull request #26.
This commit is contained in:
2026-10-26 09:36:23 +00:00
parent 2ce7db12c2
commit 017b58d6fa
804 changed files with 33423 additions and 28955 deletions

View File

@@ -0,0 +1,37 @@
use crate::support::TestContextBuilder;
use application::users::deps::GetFederatedProfileStatsDeps;
use application::users::get_federated_profile_stats;
use application::users::queries::{GetUserProfileQuery, ProfileView};
#[tokio::test]
async fn succeeds_for_a_user_id_with_no_local_row() {
let b = TestContextBuilder::new();
let deps = GetFederatedProfileStatsDeps {
stats: b.stats_repo.clone(),
diary: b.diary_repo.clone(),
social_query: b.social_query_unified.clone(),
};
let synthetic_user_id = uuid::Uuid::new_v4();
let result = get_federated_profile_stats::execute(
&deps,
GetUserProfileQuery {
user_id: synthetic_user_id,
view: ProfileView::Recent,
limit: None,
offset: None,
sort_by: domain::models::FeedSortBy::Date,
search: None,
is_own_profile: false,
include_remote: true,
},
)
.await;
assert!(
result.is_ok(),
"execute must not hard-fail for a user_id absent from the local `users` table \
(the federated-profile call shape) — got Err"
);
}