Cypress test for incoming verification requests (#11123)

* Cypress: move verification tests to their own file

* Remove redundant cypress test

This does nothing that the verification test doesn't do better.

* Factor `beginKeyVerification` call out of `doTwoWaySasVerification`

... for more flexibility. This allows us to have tests where the other side
picks the verification method.

* Cypress test for incoming verification requests
This commit is contained in:
Richard van der Hoff 2023-06-22 10:43:49 +01:00 committed by GitHub
parent 9f580a8680
commit 35f8c525aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 227 additions and 140 deletions

View file

@ -17,6 +17,7 @@ limitations under the License.
/// <reference types="cypress" />
import "cypress-each";
import EventEmitter from "events";
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
@ -75,3 +76,10 @@ export function skipIfRustCrypto() {
export function isRustCryptoEnabled(): boolean {
return !!Cypress.env("RUST_CRYPTO");
}
/**
* Returns a Promise which will resolve when the given event emitter emits a given event
*/
export function emitPromise(e: EventEmitter, k: string | symbol) {
return new Promise((r) => e.once(k, r));
}