You've already forked AstralRinth
forked from didirus/AstralRinth
Fix clippy errors + lint, use turbo CI
This commit is contained in:
@@ -8,18 +8,31 @@ use crate::common::api_common::ApiTeams;
|
||||
mod common;
|
||||
|
||||
#[actix_rt::test]
|
||||
pub async fn get_user_notifications_after_team_invitation_returns_notification() {
|
||||
pub async fn get_user_notifications_after_team_invitation_returns_notification()
|
||||
{
|
||||
with_test_environment_all(None, |test_env| async move {
|
||||
let alpha_team_id = test_env.dummy.project_alpha.team_id.clone();
|
||||
let api = test_env.api;
|
||||
api.get_user_notifications_deserialized_common(FRIEND_USER_ID, FRIEND_USER_PAT)
|
||||
.await;
|
||||
api.get_user_notifications_deserialized_common(
|
||||
FRIEND_USER_ID,
|
||||
FRIEND_USER_PAT,
|
||||
)
|
||||
.await;
|
||||
|
||||
api.add_user_to_team(&alpha_team_id, FRIEND_USER_ID, None, None, USER_USER_PAT)
|
||||
.await;
|
||||
api.add_user_to_team(
|
||||
&alpha_team_id,
|
||||
FRIEND_USER_ID,
|
||||
None,
|
||||
None,
|
||||
USER_USER_PAT,
|
||||
)
|
||||
.await;
|
||||
|
||||
let notifications = api
|
||||
.get_user_notifications_deserialized_common(FRIEND_USER_ID, FRIEND_USER_PAT)
|
||||
.get_user_notifications_deserialized_common(
|
||||
FRIEND_USER_ID,
|
||||
FRIEND_USER_PAT,
|
||||
)
|
||||
.await;
|
||||
assert_eq!(1, notifications.len());
|
||||
})
|
||||
@@ -27,12 +40,16 @@ pub async fn get_user_notifications_after_team_invitation_returns_notification()
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
pub async fn get_user_notifications_after_reading_indicates_notification_read() {
|
||||
pub async fn get_user_notifications_after_reading_indicates_notification_read()
|
||||
{
|
||||
with_test_environment_all(None, |test_env| async move {
|
||||
test_env.generate_friend_user_notification().await;
|
||||
let api = test_env.api;
|
||||
let notifications = api
|
||||
.get_user_notifications_deserialized_common(FRIEND_USER_ID, FRIEND_USER_PAT)
|
||||
.get_user_notifications_deserialized_common(
|
||||
FRIEND_USER_ID,
|
||||
FRIEND_USER_PAT,
|
||||
)
|
||||
.await;
|
||||
assert_eq!(1, notifications.len());
|
||||
let notification_id = notifications[0].id.to_string();
|
||||
@@ -41,7 +58,10 @@ pub async fn get_user_notifications_after_reading_indicates_notification_read()
|
||||
.await;
|
||||
|
||||
let notifications = api
|
||||
.get_user_notifications_deserialized_common(FRIEND_USER_ID, FRIEND_USER_PAT)
|
||||
.get_user_notifications_deserialized_common(
|
||||
FRIEND_USER_ID,
|
||||
FRIEND_USER_PAT,
|
||||
)
|
||||
.await;
|
||||
assert_eq!(1, notifications.len());
|
||||
assert!(notifications[0].read);
|
||||
@@ -50,12 +70,16 @@ pub async fn get_user_notifications_after_reading_indicates_notification_read()
|
||||
}
|
||||
|
||||
#[actix_rt::test]
|
||||
pub async fn get_user_notifications_after_deleting_does_not_show_notification() {
|
||||
pub async fn get_user_notifications_after_deleting_does_not_show_notification()
|
||||
{
|
||||
with_test_environment_all(None, |test_env| async move {
|
||||
test_env.generate_friend_user_notification().await;
|
||||
let api = test_env.api;
|
||||
let notifications = api
|
||||
.get_user_notifications_deserialized_common(FRIEND_USER_ID, FRIEND_USER_PAT)
|
||||
.get_user_notifications_deserialized_common(
|
||||
FRIEND_USER_ID,
|
||||
FRIEND_USER_PAT,
|
||||
)
|
||||
.await;
|
||||
assert_eq!(1, notifications.len());
|
||||
let notification_id = notifications[0].id.to_string();
|
||||
@@ -64,7 +88,10 @@ pub async fn get_user_notifications_after_deleting_does_not_show_notification()
|
||||
.await;
|
||||
|
||||
let notifications = api
|
||||
.get_user_notifications_deserialized_common(FRIEND_USER_ID, FRIEND_USER_PAT)
|
||||
.get_user_notifications_deserialized_common(
|
||||
FRIEND_USER_ID,
|
||||
FRIEND_USER_PAT,
|
||||
)
|
||||
.await;
|
||||
assert_eq!(0, notifications.len());
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user