2024-01-30 17:19:34 +01:00
|
|
|
// This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
Join/Leave Guilds, (Group) DMs and minor improvements (#157)
## Summary:
**Added:**
- Schemas `PrivateChannelCreateSchema` `ChannelInviteCreateSchema`, `AddChannelRecipientSchema` recursively (including schemas which were needed to create these schemas)
- Methods `create_private_channel`, `leave_guild`, `accept_invite`, `create_user_invite`, `create_guild_invite`, `add_channel_recipient`, `remove_channel_recipient`
- Integration tests for the functionality covered by implementing #45
- Documentation in some places where I noticed it would be useful to have some
- `create_user` method in `/src/tests`: Cuts down on test boilerplate needed to create an addition test user
**Changed:**
- `.gitignore`
- Added `.DS_store` files to gitignore (some weird macos files), removed Cargo.lock, as Cargo.lock should be included for libraries
- Added a lot of default trait derives like Clone, Copy, PartialEq, Eq, Ord, PartialOrd to structs and enums where I saw them missing
- Added missing `teardown()` calls to the integration tests
- Renamed integration test files in `/src/tests` dir to all be plural: `channel.rs` -> `channels.rs`
- Made more fields on `User` type `Option<>`
- All instances in `/src/tests` where a second test user was created using a RegistrationSchema and the register_user method were replaced with the new `create_user` method
- README.md: Marked roadmap fields covered by #45 as implemented
- Changed visibility of `/src/tests/common/mod.rs` methods from `pub` to `pub(crate)`. In hindsight, this was probably not required, haha
**Removed:**
- Unneeded import in`src/types/config/types/guild_configuration.rs`
## Commit log:
* Add .DS_store, remove Cargo.lock
* Create PrivateChannelCreateSchema
* pub use users
* add channels.rs
* create channels.rs
* Add Deserialize/Serialize derives
* Implement create_private_channel
* Add create_dm() test
* Make optional fields on `User` `Option<>`
* Check boxes for implemented features
* Create users/guilds.rs
* Remove unneeded import
* Add UserMeta::leave_guild()
* Create api/invites/mod.rs
* Add debug print to send_request
* Rename tests files
* Create invites.rs
* create invite.rs
* Add documentation
* Implement accept_invite
* Sort fields on Channel alphabetically
* Add invite mod
* Add forgotten teardown() at test end
* change visiblities, add create_user()
* Implement `create_user_invite()`
* start working on invite tests
* Add allow flags
* Fix bad url
* Create CreateChannelInviteSchema and friends
* remove non-implemented test code
* add body to requests
* Add Clone to UserMeta
* More comprehensive error message when running into a deserialization error
* Add arguments documentation to accept_invite
* Add Eq derive to GuildFeaturesList
* Add Eq derive to Emoji
* Add Eq derive to GuildBan
* Add create_accept_invite() test
* Add Default derive to ChannelCreateSchema
* Change create_guild_invite to return GuildInvite
* Dates as chrono::Date(Utc); sort alphabetically
* Add default derives wherever possible
* Implement add_- and remove_channel_recipient
* Create AddChannelRecipientSchema
* replace otheruser regs with bundle.creeate_user()
* Add (disabled) test remove_add_person_from_to_dm()
2023-07-17 19:36:28 +02:00
|
|
|
use chorus::types::{self, Relationship, RelationshipType};
|
2023-11-20 14:03:06 +01:00
|
|
|
#[cfg(target_arch = "wasm32")]
|
|
|
|
use wasm_bindgen_test::*;
|
|
|
|
#[cfg(target_arch = "wasm32")]
|
|
|
|
wasm_bindgen_test_configure!(run_in_browser);
|
2023-06-15 18:48:01 +02:00
|
|
|
|
|
|
|
mod common;
|
|
|
|
|
2023-11-22 14:39:32 +01:00
|
|
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
|
|
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
2023-06-15 18:48:01 +02:00
|
|
|
async fn test_get_mutual_relationships() {
|
2023-06-18 15:39:40 +02:00
|
|
|
let mut bundle = common::setup().await;
|
Join/Leave Guilds, (Group) DMs and minor improvements (#157)
## Summary:
**Added:**
- Schemas `PrivateChannelCreateSchema` `ChannelInviteCreateSchema`, `AddChannelRecipientSchema` recursively (including schemas which were needed to create these schemas)
- Methods `create_private_channel`, `leave_guild`, `accept_invite`, `create_user_invite`, `create_guild_invite`, `add_channel_recipient`, `remove_channel_recipient`
- Integration tests for the functionality covered by implementing #45
- Documentation in some places where I noticed it would be useful to have some
- `create_user` method in `/src/tests`: Cuts down on test boilerplate needed to create an addition test user
**Changed:**
- `.gitignore`
- Added `.DS_store` files to gitignore (some weird macos files), removed Cargo.lock, as Cargo.lock should be included for libraries
- Added a lot of default trait derives like Clone, Copy, PartialEq, Eq, Ord, PartialOrd to structs and enums where I saw them missing
- Added missing `teardown()` calls to the integration tests
- Renamed integration test files in `/src/tests` dir to all be plural: `channel.rs` -> `channels.rs`
- Made more fields on `User` type `Option<>`
- All instances in `/src/tests` where a second test user was created using a RegistrationSchema and the register_user method were replaced with the new `create_user` method
- README.md: Marked roadmap fields covered by #45 as implemented
- Changed visibility of `/src/tests/common/mod.rs` methods from `pub` to `pub(crate)`. In hindsight, this was probably not required, haha
**Removed:**
- Unneeded import in`src/types/config/types/guild_configuration.rs`
## Commit log:
* Add .DS_store, remove Cargo.lock
* Create PrivateChannelCreateSchema
* pub use users
* add channels.rs
* create channels.rs
* Add Deserialize/Serialize derives
* Implement create_private_channel
* Add create_dm() test
* Make optional fields on `User` `Option<>`
* Check boxes for implemented features
* Create users/guilds.rs
* Remove unneeded import
* Add UserMeta::leave_guild()
* Create api/invites/mod.rs
* Add debug print to send_request
* Rename tests files
* Create invites.rs
* create invite.rs
* Add documentation
* Implement accept_invite
* Sort fields on Channel alphabetically
* Add invite mod
* Add forgotten teardown() at test end
* change visiblities, add create_user()
* Implement `create_user_invite()`
* start working on invite tests
* Add allow flags
* Fix bad url
* Create CreateChannelInviteSchema and friends
* remove non-implemented test code
* add body to requests
* Add Clone to UserMeta
* More comprehensive error message when running into a deserialization error
* Add arguments documentation to accept_invite
* Add Eq derive to GuildFeaturesList
* Add Eq derive to Emoji
* Add Eq derive to GuildBan
* Add create_accept_invite() test
* Add Default derive to ChannelCreateSchema
* Change create_guild_invite to return GuildInvite
* Dates as chrono::Date(Utc); sort alphabetically
* Add default derives wherever possible
* Implement add_- and remove_channel_recipient
* Create AddChannelRecipientSchema
* replace otheruser regs with bundle.creeate_user()
* Add (disabled) test remove_add_person_from_to_dm()
2023-07-17 19:36:28 +02:00
|
|
|
let mut other_user = bundle.create_user("integrationtestuser2").await;
|
2023-06-18 15:39:40 +02:00
|
|
|
let user = &mut bundle.user;
|
2024-07-05 18:15:24 +02:00
|
|
|
|
|
|
|
let username = user.object.as_ref().unwrap().read().unwrap().username.clone();
|
|
|
|
let discriminator = user.object.as_ref().unwrap().read().unwrap().discriminator.clone();
|
|
|
|
let other_user_id: types::Snowflake = other_user.object.as_ref().unwrap().read().unwrap().id;
|
2023-06-18 13:59:11 +02:00
|
|
|
let friend_request_schema = types::FriendRequestSendSchema {
|
2023-08-04 11:42:28 +02:00
|
|
|
username,
|
|
|
|
discriminator: Some(discriminator),
|
2023-06-18 13:59:11 +02:00
|
|
|
};
|
2023-08-04 11:42:28 +02:00
|
|
|
other_user
|
|
|
|
.send_friend_request(friend_request_schema)
|
|
|
|
.await
|
|
|
|
.unwrap();
|
2023-08-04 11:19:23 +02:00
|
|
|
let relationships = user.get_mutual_relationships(other_user_id).await.unwrap();
|
2023-06-18 15:39:40 +02:00
|
|
|
println!("{:?}", relationships);
|
|
|
|
common::teardown(bundle).await
|
|
|
|
}
|
|
|
|
|
2023-11-22 14:39:32 +01:00
|
|
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
|
|
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
2023-06-18 15:39:40 +02:00
|
|
|
async fn test_get_relationships() {
|
|
|
|
let mut bundle = common::setup().await;
|
Join/Leave Guilds, (Group) DMs and minor improvements (#157)
## Summary:
**Added:**
- Schemas `PrivateChannelCreateSchema` `ChannelInviteCreateSchema`, `AddChannelRecipientSchema` recursively (including schemas which were needed to create these schemas)
- Methods `create_private_channel`, `leave_guild`, `accept_invite`, `create_user_invite`, `create_guild_invite`, `add_channel_recipient`, `remove_channel_recipient`
- Integration tests for the functionality covered by implementing #45
- Documentation in some places where I noticed it would be useful to have some
- `create_user` method in `/src/tests`: Cuts down on test boilerplate needed to create an addition test user
**Changed:**
- `.gitignore`
- Added `.DS_store` files to gitignore (some weird macos files), removed Cargo.lock, as Cargo.lock should be included for libraries
- Added a lot of default trait derives like Clone, Copy, PartialEq, Eq, Ord, PartialOrd to structs and enums where I saw them missing
- Added missing `teardown()` calls to the integration tests
- Renamed integration test files in `/src/tests` dir to all be plural: `channel.rs` -> `channels.rs`
- Made more fields on `User` type `Option<>`
- All instances in `/src/tests` where a second test user was created using a RegistrationSchema and the register_user method were replaced with the new `create_user` method
- README.md: Marked roadmap fields covered by #45 as implemented
- Changed visibility of `/src/tests/common/mod.rs` methods from `pub` to `pub(crate)`. In hindsight, this was probably not required, haha
**Removed:**
- Unneeded import in`src/types/config/types/guild_configuration.rs`
## Commit log:
* Add .DS_store, remove Cargo.lock
* Create PrivateChannelCreateSchema
* pub use users
* add channels.rs
* create channels.rs
* Add Deserialize/Serialize derives
* Implement create_private_channel
* Add create_dm() test
* Make optional fields on `User` `Option<>`
* Check boxes for implemented features
* Create users/guilds.rs
* Remove unneeded import
* Add UserMeta::leave_guild()
* Create api/invites/mod.rs
* Add debug print to send_request
* Rename tests files
* Create invites.rs
* create invite.rs
* Add documentation
* Implement accept_invite
* Sort fields on Channel alphabetically
* Add invite mod
* Add forgotten teardown() at test end
* change visiblities, add create_user()
* Implement `create_user_invite()`
* start working on invite tests
* Add allow flags
* Fix bad url
* Create CreateChannelInviteSchema and friends
* remove non-implemented test code
* add body to requests
* Add Clone to UserMeta
* More comprehensive error message when running into a deserialization error
* Add arguments documentation to accept_invite
* Add Eq derive to GuildFeaturesList
* Add Eq derive to Emoji
* Add Eq derive to GuildBan
* Add create_accept_invite() test
* Add Default derive to ChannelCreateSchema
* Change create_guild_invite to return GuildInvite
* Dates as chrono::Date(Utc); sort alphabetically
* Add default derives wherever possible
* Implement add_- and remove_channel_recipient
* Create AddChannelRecipientSchema
* replace otheruser regs with bundle.creeate_user()
* Add (disabled) test remove_add_person_from_to_dm()
2023-07-17 19:36:28 +02:00
|
|
|
let mut other_user = bundle.create_user("integrationtestuser2").await;
|
2023-06-18 15:39:40 +02:00
|
|
|
let user = &mut bundle.user;
|
2024-07-05 18:15:24 +02:00
|
|
|
let username = user.object.as_ref().unwrap().read().unwrap().username.clone();
|
|
|
|
let discriminator = user.object.as_ref().unwrap().read().unwrap().discriminator.clone();
|
2023-06-18 15:39:40 +02:00
|
|
|
let friend_request_schema = types::FriendRequestSendSchema {
|
2023-08-04 11:34:03 +02:00
|
|
|
username,
|
|
|
|
discriminator: Some(discriminator),
|
2023-06-18 15:39:40 +02:00
|
|
|
};
|
2023-07-09 18:38:02 +02:00
|
|
|
other_user
|
|
|
|
.send_friend_request(friend_request_schema)
|
|
|
|
.await
|
|
|
|
.unwrap();
|
2023-06-18 15:39:40 +02:00
|
|
|
let relationships = user.get_relationships().await.unwrap();
|
2023-08-04 11:19:23 +02:00
|
|
|
assert_eq!(
|
|
|
|
relationships.get(0).unwrap().id,
|
2024-07-05 18:15:24 +02:00
|
|
|
other_user.object.unwrap().read().unwrap().id
|
2023-08-04 11:19:23 +02:00
|
|
|
);
|
2023-06-19 18:11:53 +02:00
|
|
|
common::teardown(bundle).await
|
|
|
|
}
|
|
|
|
|
2023-11-22 14:39:32 +01:00
|
|
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
|
|
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
2023-06-19 18:11:53 +02:00
|
|
|
async fn test_modify_relationship_friends() {
|
|
|
|
let mut bundle = common::setup().await;
|
Join/Leave Guilds, (Group) DMs and minor improvements (#157)
## Summary:
**Added:**
- Schemas `PrivateChannelCreateSchema` `ChannelInviteCreateSchema`, `AddChannelRecipientSchema` recursively (including schemas which were needed to create these schemas)
- Methods `create_private_channel`, `leave_guild`, `accept_invite`, `create_user_invite`, `create_guild_invite`, `add_channel_recipient`, `remove_channel_recipient`
- Integration tests for the functionality covered by implementing #45
- Documentation in some places where I noticed it would be useful to have some
- `create_user` method in `/src/tests`: Cuts down on test boilerplate needed to create an addition test user
**Changed:**
- `.gitignore`
- Added `.DS_store` files to gitignore (some weird macos files), removed Cargo.lock, as Cargo.lock should be included for libraries
- Added a lot of default trait derives like Clone, Copy, PartialEq, Eq, Ord, PartialOrd to structs and enums where I saw them missing
- Added missing `teardown()` calls to the integration tests
- Renamed integration test files in `/src/tests` dir to all be plural: `channel.rs` -> `channels.rs`
- Made more fields on `User` type `Option<>`
- All instances in `/src/tests` where a second test user was created using a RegistrationSchema and the register_user method were replaced with the new `create_user` method
- README.md: Marked roadmap fields covered by #45 as implemented
- Changed visibility of `/src/tests/common/mod.rs` methods from `pub` to `pub(crate)`. In hindsight, this was probably not required, haha
**Removed:**
- Unneeded import in`src/types/config/types/guild_configuration.rs`
## Commit log:
* Add .DS_store, remove Cargo.lock
* Create PrivateChannelCreateSchema
* pub use users
* add channels.rs
* create channels.rs
* Add Deserialize/Serialize derives
* Implement create_private_channel
* Add create_dm() test
* Make optional fields on `User` `Option<>`
* Check boxes for implemented features
* Create users/guilds.rs
* Remove unneeded import
* Add UserMeta::leave_guild()
* Create api/invites/mod.rs
* Add debug print to send_request
* Rename tests files
* Create invites.rs
* create invite.rs
* Add documentation
* Implement accept_invite
* Sort fields on Channel alphabetically
* Add invite mod
* Add forgotten teardown() at test end
* change visiblities, add create_user()
* Implement `create_user_invite()`
* start working on invite tests
* Add allow flags
* Fix bad url
* Create CreateChannelInviteSchema and friends
* remove non-implemented test code
* add body to requests
* Add Clone to UserMeta
* More comprehensive error message when running into a deserialization error
* Add arguments documentation to accept_invite
* Add Eq derive to GuildFeaturesList
* Add Eq derive to Emoji
* Add Eq derive to GuildBan
* Add create_accept_invite() test
* Add Default derive to ChannelCreateSchema
* Change create_guild_invite to return GuildInvite
* Dates as chrono::Date(Utc); sort alphabetically
* Add default derives wherever possible
* Implement add_- and remove_channel_recipient
* Create AddChannelRecipientSchema
* replace otheruser regs with bundle.creeate_user()
* Add (disabled) test remove_add_person_from_to_dm()
2023-07-17 19:36:28 +02:00
|
|
|
let mut other_user = bundle.create_user("integrationtestuser2").await;
|
2023-06-19 18:11:53 +02:00
|
|
|
let user = &mut bundle.user;
|
2024-07-05 18:15:24 +02:00
|
|
|
let user_id: types::Snowflake = user.object.as_ref().unwrap().read().unwrap().id;
|
|
|
|
let other_user_id: types::Snowflake = other_user.object.as_ref().unwrap().read().unwrap().id;
|
2023-08-04 11:19:23 +02:00
|
|
|
|
|
|
|
other_user
|
|
|
|
.modify_user_relationship(user_id, types::RelationshipType::Friends)
|
|
|
|
.await
|
|
|
|
.unwrap();
|
2023-06-19 18:11:53 +02:00
|
|
|
let relationships = user.get_relationships().await.unwrap();
|
2023-08-04 11:19:23 +02:00
|
|
|
assert_eq!(
|
|
|
|
relationships.get(0).unwrap().id,
|
2024-07-05 18:15:24 +02:00
|
|
|
other_user.object.as_ref().unwrap().read().unwrap().id
|
2023-08-04 11:19:23 +02:00
|
|
|
);
|
2023-06-19 18:11:53 +02:00
|
|
|
assert_eq!(
|
|
|
|
relationships.get(0).unwrap().relationship_type,
|
|
|
|
RelationshipType::Incoming
|
|
|
|
);
|
|
|
|
let relationships = other_user.get_relationships().await.unwrap();
|
2023-08-04 11:19:23 +02:00
|
|
|
assert_eq!(
|
|
|
|
relationships.get(0).unwrap().id,
|
2024-07-05 18:15:24 +02:00
|
|
|
user.object.as_ref().unwrap().read().unwrap().id
|
2023-08-04 11:19:23 +02:00
|
|
|
);
|
2023-06-19 18:11:53 +02:00
|
|
|
assert_eq!(
|
|
|
|
relationships.get(0).unwrap().relationship_type,
|
|
|
|
RelationshipType::Outgoing
|
|
|
|
);
|
2023-07-09 18:38:02 +02:00
|
|
|
let _ = user
|
2023-08-04 11:19:23 +02:00
|
|
|
.modify_user_relationship(other_user_id, RelationshipType::Friends)
|
2023-06-22 13:14:07 +02:00
|
|
|
.await;
|
2023-06-19 18:11:53 +02:00
|
|
|
assert_eq!(
|
|
|
|
other_user
|
|
|
|
.get_relationships()
|
|
|
|
.await
|
|
|
|
.unwrap()
|
|
|
|
.get(0)
|
|
|
|
.unwrap()
|
|
|
|
.relationship_type,
|
|
|
|
RelationshipType::Friends
|
|
|
|
);
|
2023-08-04 11:19:23 +02:00
|
|
|
let _ = user.remove_relationship(other_user_id).await;
|
2023-06-19 18:11:53 +02:00
|
|
|
assert_eq!(
|
|
|
|
other_user.get_relationships().await.unwrap(),
|
|
|
|
Vec::<Relationship>::new()
|
|
|
|
);
|
2023-06-18 15:39:40 +02:00
|
|
|
common::teardown(bundle).await
|
2023-06-15 18:48:01 +02:00
|
|
|
}
|
2023-06-19 18:46:49 +02:00
|
|
|
|
2023-11-22 14:39:32 +01:00
|
|
|
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test::wasm_bindgen_test)]
|
|
|
|
#[cfg_attr(not(target_arch = "wasm32"), tokio::test)]
|
2023-06-19 18:46:49 +02:00
|
|
|
async fn test_modify_relationship_block() {
|
|
|
|
let mut bundle = common::setup().await;
|
Join/Leave Guilds, (Group) DMs and minor improvements (#157)
## Summary:
**Added:**
- Schemas `PrivateChannelCreateSchema` `ChannelInviteCreateSchema`, `AddChannelRecipientSchema` recursively (including schemas which were needed to create these schemas)
- Methods `create_private_channel`, `leave_guild`, `accept_invite`, `create_user_invite`, `create_guild_invite`, `add_channel_recipient`, `remove_channel_recipient`
- Integration tests for the functionality covered by implementing #45
- Documentation in some places where I noticed it would be useful to have some
- `create_user` method in `/src/tests`: Cuts down on test boilerplate needed to create an addition test user
**Changed:**
- `.gitignore`
- Added `.DS_store` files to gitignore (some weird macos files), removed Cargo.lock, as Cargo.lock should be included for libraries
- Added a lot of default trait derives like Clone, Copy, PartialEq, Eq, Ord, PartialOrd to structs and enums where I saw them missing
- Added missing `teardown()` calls to the integration tests
- Renamed integration test files in `/src/tests` dir to all be plural: `channel.rs` -> `channels.rs`
- Made more fields on `User` type `Option<>`
- All instances in `/src/tests` where a second test user was created using a RegistrationSchema and the register_user method were replaced with the new `create_user` method
- README.md: Marked roadmap fields covered by #45 as implemented
- Changed visibility of `/src/tests/common/mod.rs` methods from `pub` to `pub(crate)`. In hindsight, this was probably not required, haha
**Removed:**
- Unneeded import in`src/types/config/types/guild_configuration.rs`
## Commit log:
* Add .DS_store, remove Cargo.lock
* Create PrivateChannelCreateSchema
* pub use users
* add channels.rs
* create channels.rs
* Add Deserialize/Serialize derives
* Implement create_private_channel
* Add create_dm() test
* Make optional fields on `User` `Option<>`
* Check boxes for implemented features
* Create users/guilds.rs
* Remove unneeded import
* Add UserMeta::leave_guild()
* Create api/invites/mod.rs
* Add debug print to send_request
* Rename tests files
* Create invites.rs
* create invite.rs
* Add documentation
* Implement accept_invite
* Sort fields on Channel alphabetically
* Add invite mod
* Add forgotten teardown() at test end
* change visiblities, add create_user()
* Implement `create_user_invite()`
* start working on invite tests
* Add allow flags
* Fix bad url
* Create CreateChannelInviteSchema and friends
* remove non-implemented test code
* add body to requests
* Add Clone to UserMeta
* More comprehensive error message when running into a deserialization error
* Add arguments documentation to accept_invite
* Add Eq derive to GuildFeaturesList
* Add Eq derive to Emoji
* Add Eq derive to GuildBan
* Add create_accept_invite() test
* Add Default derive to ChannelCreateSchema
* Change create_guild_invite to return GuildInvite
* Dates as chrono::Date(Utc); sort alphabetically
* Add default derives wherever possible
* Implement add_- and remove_channel_recipient
* Create AddChannelRecipientSchema
* replace otheruser regs with bundle.creeate_user()
* Add (disabled) test remove_add_person_from_to_dm()
2023-07-17 19:36:28 +02:00
|
|
|
let mut other_user = bundle.create_user("integrationtestuser2").await;
|
2023-06-19 18:46:49 +02:00
|
|
|
let user = &mut bundle.user;
|
2024-07-05 18:15:24 +02:00
|
|
|
let user_id: types::Snowflake = user.object.as_ref().unwrap().read().unwrap().id;
|
2023-08-04 11:19:23 +02:00
|
|
|
|
|
|
|
other_user
|
|
|
|
.modify_user_relationship(user_id, types::RelationshipType::Blocked)
|
|
|
|
.await
|
|
|
|
.unwrap();
|
2023-06-19 18:46:49 +02:00
|
|
|
let relationships = user.get_relationships().await.unwrap();
|
|
|
|
assert_eq!(relationships, Vec::<Relationship>::new());
|
|
|
|
let relationships = other_user.get_relationships().await.unwrap();
|
2023-08-04 11:19:23 +02:00
|
|
|
assert_eq!(
|
|
|
|
relationships.get(0).unwrap().id,
|
2024-07-05 18:15:24 +02:00
|
|
|
user.object.as_ref().unwrap().read().unwrap().id
|
2023-08-04 11:19:23 +02:00
|
|
|
);
|
2023-06-19 18:46:49 +02:00
|
|
|
assert_eq!(
|
|
|
|
relationships.get(0).unwrap().relationship_type,
|
|
|
|
RelationshipType::Blocked
|
|
|
|
);
|
2023-08-04 11:19:23 +02:00
|
|
|
other_user.remove_relationship(user_id).await.unwrap();
|
2023-06-19 18:46:49 +02:00
|
|
|
assert_eq!(
|
|
|
|
other_user.get_relationships().await.unwrap(),
|
|
|
|
Vec::<Relationship>::new()
|
|
|
|
);
|
|
|
|
common::teardown(bundle).await
|
|
|
|
}
|