mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +03:00
fix: let search also return hidden contacts if search value is an email address
This commit is contained in:
@@ -420,12 +420,16 @@ async fn test_delete() -> Result<()> {
|
||||
Contact::delete(&alice, contact_id).await?;
|
||||
let contact = Contact::get_by_id(&alice, contact_id).await?;
|
||||
assert_eq!(contact.origin, Origin::Hidden);
|
||||
|
||||
// Hidden contacts are found when searching by email address
|
||||
assert_eq!(
|
||||
Contact::get_all(&alice, 0, Some("bob@example.net"))
|
||||
.await?
|
||||
.len(),
|
||||
0
|
||||
1
|
||||
);
|
||||
// Hidden contacts are not found by a non-address query
|
||||
assert_eq!(Contact::get_all(&alice, 0, Some("bob")).await?.len(), 0);
|
||||
|
||||
// Delete chat.
|
||||
chat.get_id().delete(&alice).await?;
|
||||
@@ -483,7 +487,7 @@ async fn test_delete_and_recreate_contact() -> Result<()> {
|
||||
Contact::get_all(&t, 0, Some("bob@example.net"))
|
||||
.await?
|
||||
.len(),
|
||||
0
|
||||
1
|
||||
);
|
||||
|
||||
let contact_id3 = t.add_or_lookup_contact_id(&bob).await;
|
||||
|
||||
Reference in New Issue
Block a user