refactor(tests): remove unused value_objects imports from test files
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
use super::*;
|
|
||||||
use domain::{
|
use domain::{
|
||||||
events::DomainEvent,
|
events::DomainEvent,
|
||||||
value_objects::{LikeId, ThoughtId, UserId},
|
value_objects::{LikeId, ThoughtId, UserId},
|
||||||
|
|||||||
@@ -756,7 +756,7 @@ impl PostgresApUserRepository {
|
|||||||
also_known_as: r.also_known_as.into_iter().collect(),
|
also_known_as: r.also_known_as.into_iter().collect(),
|
||||||
profile_url,
|
profile_url,
|
||||||
attachment: vec![],
|
attachment: vec![],
|
||||||
manually_approves_followers: false,
|
manually_approves_followers: true,
|
||||||
discoverable: true,
|
discoverable: true,
|
||||||
actor_type: ApActorType::default(),
|
actor_type: ApActorType::default(),
|
||||||
featured_url: None,
|
featured_url: None,
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ use domain::{
|
|||||||
user::User,
|
user::User,
|
||||||
},
|
},
|
||||||
ports::{SearchPort, ThoughtRepository, UserWriter},
|
ports::{SearchPort, ThoughtRepository, UserWriter},
|
||||||
value_objects::*,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
async fn seed_thought(pool: &sqlx::PgPool, username: &str, content: &str) -> (User, Thought) {
|
async fn seed_thought(pool: &sqlx::PgPool, username: &str, content: &str) -> (User, Thought) {
|
||||||
@@ -102,9 +101,9 @@ async fn search_thoughts_returns_empty_for_no_match(pool: sqlx::PgPool) {
|
|||||||
#[sqlx::test(migrations = "../postgres/migrations")]
|
#[sqlx::test(migrations = "../postgres/migrations")]
|
||||||
async fn search_thoughts_viewer_context(pool: sqlx::PgPool) {
|
async fn search_thoughts_viewer_context(pool: sqlx::PgPool) {
|
||||||
use domain::models::social::Like;
|
use domain::models::social::Like;
|
||||||
use domain::ports::{LikeRepository, UserWriter};
|
use domain::ports::LikeRepository;
|
||||||
use domain::value_objects::LikeId;
|
use domain::value_objects::LikeId;
|
||||||
use postgres::{like::PgLikeRepository, user::PgUserRepository};
|
use postgres::like::PgLikeRepository;
|
||||||
|
|
||||||
let (alice, thought) = seed_thought(&pool, "alice", "hello world").await;
|
let (alice, thought) = seed_thought(&pool, "alice", "hello world").await;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::test_helpers::seed_user;
|
use crate::test_helpers::seed_user;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use domain::value_objects::*;
|
|
||||||
|
|
||||||
#[sqlx::test(migrations = "./migrations")]
|
#[sqlx::test(migrations = "./migrations")]
|
||||||
async fn block_exists(pool: sqlx::PgPool) {
|
async fn block_exists(pool: sqlx::PgPool) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::test_helpers::seed_user_and_thought;
|
use crate::test_helpers::seed_user_and_thought;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use domain::value_objects::*;
|
|
||||||
|
|
||||||
#[sqlx::test(migrations = "./migrations")]
|
#[sqlx::test(migrations = "./migrations")]
|
||||||
async fn boost_and_count(pool: sqlx::PgPool) {
|
async fn boost_and_count(pool: sqlx::PgPool) {
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ use domain::{
|
|||||||
user::User,
|
user::User,
|
||||||
},
|
},
|
||||||
ports::{FeedOptions, FeedQuery, FeedRequest, ThoughtRepository, UserWriter},
|
ports::{FeedOptions, FeedQuery, FeedRequest, ThoughtRepository, UserWriter},
|
||||||
value_objects::*,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
async fn seed(pool: &sqlx::PgPool, username: &str, content: &str) -> (User, Thought) {
|
async fn seed(pool: &sqlx::PgPool, username: &str, content: &str) -> (User, Thought) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::test_helpers::seed_user;
|
use crate::test_helpers::seed_user;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use domain::value_objects::*;
|
|
||||||
|
|
||||||
#[sqlx::test(migrations = "./migrations")]
|
#[sqlx::test(migrations = "./migrations")]
|
||||||
async fn save_and_find_follow(pool: sqlx::PgPool) {
|
async fn save_and_find_follow(pool: sqlx::PgPool) {
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::test_helpers::seed_user_and_thought;
|
use crate::test_helpers::seed_user_and_thought;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use domain::value_objects::*;
|
|
||||||
|
|
||||||
#[sqlx::test(migrations = "./migrations")]
|
#[sqlx::test(migrations = "./migrations")]
|
||||||
async fn like_and_count(pool: sqlx::PgPool) {
|
async fn like_and_count(pool: sqlx::PgPool) {
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::test_helpers;
|
use crate::test_helpers;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use domain::{
|
use domain::models::notification::NotificationKind;
|
||||||
models::{notification::NotificationKind, user::User},
|
|
||||||
value_objects::*,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[sqlx::test(migrations = "./migrations")]
|
#[sqlx::test(migrations = "./migrations")]
|
||||||
async fn save_and_list(pool: sqlx::PgPool) {
|
async fn save_and_list(pool: sqlx::PgPool) {
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use crate::test_helpers::seed_user;
|
use crate::test_helpers::seed_user;
|
||||||
use domain::{
|
use domain::models::thought::{NewThought, Thought, Visibility};
|
||||||
models::thought::{NewThought, Thought, Visibility},
|
|
||||||
value_objects::*,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[sqlx::test(migrations = "./migrations")]
|
#[sqlx::test(migrations = "./migrations")]
|
||||||
async fn save_and_find_thought(pool: sqlx::PgPool) {
|
async fn save_and_find_thought(pool: sqlx::PgPool) {
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
use super::*;
|
use super::*;
|
||||||
use domain::{
|
use domain::models::user::{UpdateProfileInput, User};
|
||||||
models::user::{UpdateProfileInput, User},
|
|
||||||
value_objects::*,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[sqlx::test(migrations = "./migrations")]
|
#[sqlx::test(migrations = "./migrations")]
|
||||||
async fn save_and_find_by_id(pool: sqlx::PgPool) {
|
async fn save_and_find_by_id(pool: sqlx::PgPool) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use crate::testing::make_state;
|
|||||||
use axum::{
|
use axum::{
|
||||||
body::Body,
|
body::Body,
|
||||||
http::{header, Request},
|
http::{header, Request},
|
||||||
routing::{get, patch},
|
routing::patch,
|
||||||
Router,
|
Router,
|
||||||
};
|
};
|
||||||
use tower::ServiceExt;
|
use tower::ServiceExt;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use crate::testing::make_state;
|
|||||||
use axum::{
|
use axum::{
|
||||||
body::Body,
|
body::Body,
|
||||||
http::Request,
|
http::Request,
|
||||||
routing::{delete, get, post},
|
routing::{get, post},
|
||||||
Router,
|
Router,
|
||||||
};
|
};
|
||||||
use tower::ServiceExt;
|
use tower::ServiceExt;
|
||||||
|
|||||||
Reference in New Issue
Block a user