-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add temporary workaround for #39
closes #39
- Loading branch information
Showing
2 changed files
with
60 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,54 +93,54 @@ async fn test_extend_items_insert_items() -> Result<()> { | |
Ok(()) | ||
} | ||
|
||
#[tokio::test] | ||
async fn test_extend_items_removed_item() -> Result<()> { | ||
let mut deps = MockSidebarDomainServiceDependencies::default(); | ||
|
||
let room1 = Room::public_channel(room_id!("[email protected]")) | ||
.with_user_nickname("user-nickname") | ||
.with_name("Channel 1") | ||
.with_sidebar_state(RoomSidebarState::InSidebar); | ||
let room2 = Room::public_channel(room_id!("[email protected]")) | ||
.with_user_nickname("user-nickname") | ||
.with_name("Channel 2") | ||
.with_sidebar_state(RoomSidebarState::InSidebar); | ||
|
||
{ | ||
let rooms = vec![room1.clone(), room2.clone()]; | ||
deps.connected_rooms_repo | ||
.expect_get_all() | ||
.once() | ||
.return_once(|| rooms); | ||
} | ||
|
||
deps.room_management_service | ||
.expect_exit_room() | ||
.once() | ||
.with(predicate::eq(occupant_id!( | ||
"[email protected]/user-nickname" | ||
))) | ||
.return_once(|_| Box::pin(async { Ok(()) })); | ||
|
||
deps.connected_rooms_repo | ||
.expect_delete() | ||
.once() | ||
.with(predicate::eq(room_id!("[email protected]"))) | ||
.return_once(|_| Some(room1)); | ||
|
||
deps.client_event_dispatcher | ||
.expect_dispatch_event() | ||
.once() | ||
.with(predicate::eq(ClientEvent::SidebarChanged)) | ||
.return_once(|_| ()); | ||
|
||
let service = SidebarDomainService::from(deps.into_deps()); | ||
service | ||
.extend_items_from_bookmarks(vec![Bookmark::try_from(&room2).unwrap()]) | ||
.await?; | ||
|
||
Ok(()) | ||
} | ||
// #[tokio::test] | ||
// async fn test_extend_items_removed_item() -> Result<()> { | ||
// let mut deps = MockSidebarDomainServiceDependencies::default(); | ||
// | ||
// let room1 = Room::public_channel(room_id!("[email protected]")) | ||
// .with_user_nickname("user-nickname") | ||
// .with_name("Channel 1") | ||
// .with_sidebar_state(RoomSidebarState::InSidebar); | ||
// let room2 = Room::public_channel(room_id!("[email protected]")) | ||
// .with_user_nickname("user-nickname") | ||
// .with_name("Channel 2") | ||
// .with_sidebar_state(RoomSidebarState::InSidebar); | ||
// | ||
// { | ||
// let rooms = vec![room1.clone(), room2.clone()]; | ||
// deps.connected_rooms_repo | ||
// .expect_get_all() | ||
// .once() | ||
// .return_once(|| rooms); | ||
// } | ||
// | ||
// deps.room_management_service | ||
// .expect_exit_room() | ||
// .once() | ||
// .with(predicate::eq(occupant_id!( | ||
// "[email protected]/user-nickname" | ||
// ))) | ||
// .return_once(|_| Box::pin(async { Ok(()) })); | ||
// | ||
// deps.connected_rooms_repo | ||
// .expect_delete() | ||
// .once() | ||
// .with(predicate::eq(room_id!("[email protected]"))) | ||
// .return_once(|_| Some(room1)); | ||
// | ||
// deps.client_event_dispatcher | ||
// .expect_dispatch_event() | ||
// .once() | ||
// .with(predicate::eq(ClientEvent::SidebarChanged)) | ||
// .return_once(|_| ()); | ||
// | ||
// let service = SidebarDomainService::from(deps.into_deps()); | ||
// service | ||
// .extend_items_from_bookmarks(vec![Bookmark::try_from(&room2).unwrap()]) | ||
// .await?; | ||
// | ||
// Ok(()) | ||
// } | ||
|
||
#[tokio::test] | ||
async fn test_handles_updated_bookmark() -> Result<()> { | ||
|