test: Test the response to the new session

This commit is contained in:
PapaTutuWawa 2022-08-05 15:53:16 +02:00
parent b5d39339d1
commit 399f8033a3

View File

@ -29,7 +29,25 @@ void main() {
aliceSession.device.id,
aliceMessage.encryptedKeys,
);
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);
});
}