test_support/test_helpers -> tests/support; watched_at unified w/ domain test_watched_at (2024-03-15). Kept inline: users::diary_filter tests (feed_sort_to_direction_all_variants, paged_user_filter_builds_correctly) - pub(super) helpers in private module. Dropped stale never-compiled users/tests/get_users.rs (old execute signature).
28 lines
810 B
Rust
28 lines
810 B
Rust
use domain::testing::test_movie_with_year;
|
|
use std::sync::Arc;
|
|
|
|
use domain::{ports::DiaryQuery, services::review_history::Trend};
|
|
|
|
use application::{
|
|
diary::deps::GetReviewHistoryDeps, diary::get_review_history,
|
|
diary::queries::GetReviewHistoryQuery,
|
|
};
|
|
|
|
#[tokio::test]
|
|
async fn returns_empty_history() {
|
|
let movie = test_movie_with_year("Test", 2024);
|
|
let movie_id = movie.id().value();
|
|
|
|
let diary = domain::testing::FakeDiaryQuery::new();
|
|
diary.seed_history(movie, vec![]);
|
|
let diary: Arc<dyn DiaryQuery> = diary;
|
|
let deps = GetReviewHistoryDeps { diary };
|
|
|
|
let (history, trend) = get_review_history::execute(&deps, GetReviewHistoryQuery { movie_id })
|
|
.await
|
|
.unwrap();
|
|
|
|
assert!(history.viewings().is_empty());
|
|
assert_eq!(trend, Trend::Neutral);
|
|
}
|