test: Test the response to the new session
This commit is contained in:
parent
b5d39339d1
commit
399f8033a3
@ -29,7 +29,25 @@ void main() {
|
|||||||
aliceSession.device.id,
|
aliceSession.device.id,
|
||||||
aliceMessage.encryptedKeys,
|
aliceMessage.encryptedKeys,
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(messagePlaintext, bobMessage);
|
expect(messagePlaintext, bobMessage);
|
||||||
|
|
||||||
|
// Bob responds to Alice
|
||||||
|
final bobResponseText = 'Oh, hello Alice!';
|
||||||
|
final bobResponseMessage = await bobSession.encryptToJid(
|
||||||
|
aliceJid,
|
||||||
|
bobResponseText,
|
||||||
|
);
|
||||||
|
|
||||||
|
// Bob sends the message to Alice
|
||||||
|
// ...
|
||||||
|
|
||||||
|
// Alice decrypts it
|
||||||
|
final aliceReceivedMessage = await aliceSession.decryptMessage(
|
||||||
|
bobResponseMessage.ciphertext,
|
||||||
|
bobJid,
|
||||||
|
bobSession.device.id,
|
||||||
|
bobResponseMessage.encryptedKeys,
|
||||||
|
);
|
||||||
|
expect(bobResponseText, aliceReceivedMessage);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user