Re-enable QR verification cypress test for Element-R (#11771)

* Re-enable QR verification cypress test for Element-R

This test was disabled by
https://github.com/matrix-org/matrix-react-sdk/pull/11710. The impl has now
been fixed, so it should be possible to re-enable it now.

While we're here, rename a couple of the tests for clarity.

* fix lint
This commit is contained in:
Richard van der Hoff 2023-10-18 14:27:32 +01:00 committed by GitHub
parent ff35107e9c
commit 888d01cad8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,7 @@ import type { MatrixClient } from "matrix-js-sdk/src/matrix";
import type { VerificationRequest, Verifier } from "matrix-js-sdk/src/crypto-api";
import { CypressBot } from "../../support/bot";
import { HomeserverInstance } from "../../plugins/utils/homeserver";
import { emitPromise, skipIfRustCrypto } from "../../support/util";
import { emitPromise } from "../../support/util";
import {
checkDeviceIsConnectedKeyBackup,
checkDeviceIsCrossSigned,
@ -95,7 +95,7 @@ describe("Device verification", () => {
cy.wrap(promiseVerificationRequest).as("verificationRequest");
}
it("Verify device during login with SAS", () => {
it("Verify device with SAS during login", () => {
logIntoElement(homeserver.baseUrl, aliceBotClient.getUserId(), aliceBotClient.__cypress_password);
// Launch the verification request between alice and the bot
@ -122,8 +122,8 @@ describe("Device verification", () => {
checkDeviceIsConnectedKeyBackup();
});
it("Verify device during login with QR code", () => {
skipIfRustCrypto(); // https://github.com/vector-im/element-web/issues/26293
it("Verify device with QR code during login", () => {
// A mode 0x02 verification: "self-verifying in which the current device does not yet trust the master key"
logIntoElement(homeserver.baseUrl, aliceBotClient.getUserId(), aliceBotClient.__cypress_password);
// Launch the verification request between alice and the bot
@ -156,6 +156,16 @@ describe("Device verification", () => {
// the bot uploads the signatures asynchronously, so wait for that to happen
cy.wait(1000);
// our device should trust the bot device
cy.getClient().then(async (cli) => {
const deviceStatus = await cli
.getCrypto()!
.getDeviceVerificationStatus(aliceBotClient.getUserId(), aliceBotClient.getDeviceId());
if (!deviceStatus.isVerified()) {
throw new Error("Bot device was not verified after QR code verification");
}
});
// Check that our device is now cross-signed
checkDeviceIsCrossSigned();
@ -163,7 +173,7 @@ describe("Device verification", () => {
checkDeviceIsConnectedKeyBackup();
});
it("Verify device during login with Security Phrase", () => {
it("Verify device with Security Phrase during login", () => {
logIntoElement(homeserver.baseUrl, aliceBotClient.getUserId(), aliceBotClient.__cypress_password);
// Select the security phrase
@ -188,7 +198,7 @@ describe("Device verification", () => {
checkDeviceIsConnectedKeyBackup();
});
it("Verify device during login with Security Key", () => {
it("Verify device with Security Key during login", () => {
logIntoElement(homeserver.baseUrl, aliceBotClient.getUserId(), aliceBotClient.__cypress_password);
// Select the security phrase