Minor cleanups to handleVerificationRequest in cypress tests (#10941)
* Remove redundant `verifier.done()` call This `done` call completes the verification process and stops it responding with further messages. It is unnecessary, *provided* the verification completes successfully, for which see https://github.com/matrix-org/matrix-js-sdk/pull/3382. * Remove duplicated code in `decryption-failure` test * remove unused imports
This commit is contained in:
@@ -38,21 +38,19 @@ export function waitForVerificationRequest(cli: MatrixClient): Promise<Verificat
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle an incoming verification request
|
||||
* Automatically handle an incoming verification request
|
||||
*
|
||||
* Starts the key verification process, and, once it is accepted on the other side, confirms that the
|
||||
* emojis match.
|
||||
*
|
||||
* Returns a promise that resolves, with the emoji list, once we confirm the emojis
|
||||
*
|
||||
* @param request - incoming verification request
|
||||
* @returns A promise that resolves, with the emoji list, once we confirm the emojis
|
||||
*/
|
||||
export function handleVerificationRequest(request: VerificationRequest) {
|
||||
export function handleVerificationRequest(request: VerificationRequest): Promise<EmojiMapping[]> {
|
||||
return new Promise<EmojiMapping[]>((resolve) => {
|
||||
const onShowSas = (event: ISasEvent) => {
|
||||
verifier.off("show_sas", onShowSas);
|
||||
event.confirm();
|
||||
verifier.done();
|
||||
resolve(event.sas.emoji);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user