Modrinth/apps/labrinth/tests/v2/notifications.rs
Josiah Glosson 62de07e4e6
Version updates (#3626)
* Update some Labrinth dependencies

* Update some Labrinth dependencies

* Update some Labrinth dependencies

* Update zip in Labrinth

* Update itertools in Labrinth

* Update validator in labrinth

* Update thiserror in labrinth

* Update rust_decimal, redis, and deadpool-redis in labrinth

* Update totp-rs and spdx in labrinth

* Update maxminddb and tar in labrinth

* Update sentry and sentry-actix in labrinth

* Update image in labrinth

* Update lettre in labrinth

* Update derive-new and rust_iso3166 in labrinth

* Update async-stripe and json-patch in labrinth

* Update clap and iana-time-zone in labrinth

* Update labrinth to Rust 2024

* Cargo fmt

* Just do a full cargo update

* Update daedelus to Rust 2024

* Update daedelus_client to Rust 2024

* Set the formatting edition to 2024

* Fix formatting

IntelliJ messed up my formatting
2025-05-09 12:27:55 +00:00

39 lines
1.1 KiB
Rust

use crate::common::{
api_common::ApiTeams,
api_v2::ApiV2,
database::{FRIEND_USER_ID, FRIEND_USER_PAT, USER_USER_PAT},
environment::{TestEnvironment, with_test_environment},
};
#[actix_rt::test]
pub async fn get_user_notifications_after_team_invitation_returns_notification()
{
with_test_environment(
None,
|test_env: TestEnvironment<ApiV2>| async move {
let alpha_team_id = test_env.dummy.project_alpha.team_id.clone();
let api = test_env.api;
api.add_user_to_team(
&alpha_team_id,
FRIEND_USER_ID,
None,
None,
USER_USER_PAT,
)
.await;
let notifications = api
.get_user_notifications_deserialized(
FRIEND_USER_ID,
FRIEND_USER_PAT,
)
.await;
assert_eq!(1, notifications.len());
// Check to make sure type_ is correct
assert_eq!(notifications[0].type_.as_ref().unwrap(), "team_invite");
},
)
.await;
}