Skip to content

Commit 0ff2e6b

Browse files
committed
test(crypto-js): Test `RoomMessageRequest.content.
1 parent 9928c26 commit 0ff2e6b

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/machine.test.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,20 @@ describe(OlmMachine.name, () => {
803803
expect(outgoingVerificationRequest.txn_id).toBeDefined();
804804
expect(outgoingVerificationRequest.event_type).toStrictEqual('m.key.verification.start');
805805
expect(outgoingVerificationRequest.content).toBeDefined();
806+
807+
const content = JSON.parse(outgoingVerificationRequest.content);
808+
expect(content).toMatchObject({
809+
from_device: expect.any(String),
810+
method: 'm.sas.v1',
811+
key_agreement_protocols: [expect.any(String)],
812+
hashes: [expect.any(String)],
813+
message_authentication_codes: [expect.any(String), expect.any(String)],
814+
short_authentication_string: ['decimal', 'emoji'],
815+
'm.relates_to': {
816+
rel_type: 'm.reference',
817+
event_id: eventId.toString(),
818+
}
819+
});
806820
})
807821
});
808822
});

0 commit comments

Comments
 (0)