-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: transfer vCards in TestContext.create_chat()
SecureJoin and importing a vCard are the primary ways we want to support for creating contacts. Typing in an email address and relying on Autocrypt results in sending the first message unencrypted and we want to clearly separate unencrypted and encrypted chats in the future. To make the tests more stable, we set up test contacts with vCards as this always immediately results in creating a single encrypted chat and this is not going to change.
- Loading branch information
Showing
8 changed files
with
68 additions
and
30 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 |
---|---|---|
|
@@ -1207,16 +1207,16 @@ async fn test_reset_encryption() -> Result<()> { | |
let alice = &tcm.alice().await; | ||
let bob = &tcm.bob().await; | ||
|
||
let msg = tcm.send_recv_accept(alice, bob, "Hello!").await; | ||
assert_eq!(msg.get_showpadlock(), false); | ||
|
||
let msg = tcm.send_recv(bob, alice, "Hi!").await; | ||
let msg = tcm.send_recv_accept(bob, alice, "Hi!").await; | ||
assert_eq!(msg.get_showpadlock(), true); | ||
|
||
let alice_bob_chat_id = msg.chat_id; | ||
let alice_bob_contact_id = msg.from_id; | ||
|
||
alice_bob_contact_id.reset_encryption(alice).await?; | ||
|
||
let msg = tcm.send_recv(alice, bob, "Unencrypted").await; | ||
let sent = alice.send_text(alice_bob_chat_id, "Unencrypted").await; | ||
let msg = bob.recv_msg(&sent).await; | ||
assert_eq!(msg.get_showpadlock(), false); | ||
|
||
Ok(()) | ||
|
@@ -1235,6 +1235,7 @@ async fn test_reset_verified_encryption() -> Result<()> { | |
|
||
let alice_bob_chat_id = msg.chat_id; | ||
let alice_bob_contact_id = msg.from_id; | ||
|
||
alice_bob_contact_id.reset_encryption(alice).await?; | ||
|
||
// Check that the contact is still verified after resetting encryption. | ||
|
@@ -1250,7 +1251,8 @@ async fn test_reset_verified_encryption() -> Result<()> { | |
"[email protected] sent a message from another device." | ||
); | ||
|
||
let msg = tcm.send_recv(alice, bob, "Unencrypted").await; | ||
let sent = alice.send_text(alice_bob_chat_id, "Unencrypted").await; | ||
let msg = bob.recv_msg(&sent).await; | ||
assert_eq!(msg.get_showpadlock(), false); | ||
|
||
Ok(()) | ||
|
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
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 |
---|---|---|
|
@@ -816,8 +816,13 @@ async fn test_shared_bobs_key() -> Result<()> { | |
let bob3_addr = "[email protected]"; | ||
bob3.configure_addr(bob3_addr).await; | ||
imex(bob3, ImexMode::ImportSelfKeys, export_dir.path(), None).await?; | ||
tcm.send_recv(bob3, alice, "hi Alice!").await; | ||
let msg = tcm.send_recv(alice, bob3, "hi Bob3!").await; | ||
let chat = bob3.create_email_chat(alice).await; | ||
let sent = bob3.send_text(chat.id, "hi Alice!").await; | ||
let msg = alice.recv_msg(&sent).await; | ||
assert!(!msg.get_showpadlock()); | ||
let chat = alice.create_email_chat(bob3).await; | ||
let sent = alice.send_text(chat.id, "hi Bob3!").await; | ||
let msg = bob3.recv_msg(&sent).await; | ||
assert!(msg.get_showpadlock()); | ||
|
||
let mut bob_ids = HashSet::new(); | ||
|
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