From 6f236bd32546fd34877437be22624f7c04dd5861 Mon Sep 17 00:00:00 2001 From: Florian Duros Date: Wed, 8 Jan 2025 10:53:57 +0100 Subject: [PATCH] Fix docs and naming of `utils.createBot` --- .../e2e/crypto/device-verification.spec.ts | 2 +- playwright/e2e/crypto/utils.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/playwright/e2e/crypto/device-verification.spec.ts b/playwright/e2e/crypto/device-verification.spec.ts index 774fcfb4ec..d375273ff3 100644 --- a/playwright/e2e/crypto/device-verification.spec.ts +++ b/playwright/e2e/crypto/device-verification.spec.ts @@ -30,7 +30,7 @@ test.describe("Device verification", { tag: "@no-webkit" }, () => { test.beforeEach(async ({ page, homeserver, credentials }) => { const res = await createBot(page, homeserver, credentials); - aliceBotClient = res.aliceBotClient; + aliceBotClient = res.botClient; expectedBackupVersion = res.expectedBackupVersion; }); diff --git a/playwright/e2e/crypto/utils.ts b/playwright/e2e/crypto/utils.ts index 1cf1484fd0..46e6c91ef8 100644 --- a/playwright/e2e/crypto/utils.ts +++ b/playwright/e2e/crypto/utils.ts @@ -24,7 +24,7 @@ import { ElementAppPage } from "../../pages/ElementAppPage"; import { Bot } from "../../pages/bot"; /** - * Create a new device for the Alice user. + * Create a bot client and wait for the key backup to be ready. * This function will wait for the key backup to be ready. * @param page - the page to use * @param homeserver - the homeserver to use @@ -34,21 +34,21 @@ export async function createBot( page: Page, homeserver: HomeserverInstance, credentials: Credentials, -): Promise<{ aliceBotClient: Bot; recoveryKey: GeneratedSecretStorageKey; expectedBackupVersion: string }> { +): Promise<{ botClient: Bot; recoveryKey: GeneratedSecretStorageKey; expectedBackupVersion: string }> { // Visit the login page of the app, to load the matrix sdk await page.goto("/#/login"); // wait for the page to load await page.waitForSelector(".mx_AuthPage", { timeout: 30000 }); - // Create a new device for alice - const aliceBotClient = new Bot(page, homeserver, { + // Create a new bot client + const botClient = new Bot(page, homeserver, { bootstrapCrossSigning: true, bootstrapSecretStorage: true, }); - aliceBotClient.setCredentials(credentials); + botClient.setCredentials(credentials); // Backup is prepared in the background. Poll until it is ready. - const botClientHandle = await aliceBotClient.prepareClient(); + const botClientHandle = await botClient.prepareClient(); let expectedBackupVersion: string; await expect .poll(async () => { @@ -59,9 +59,9 @@ export async function createBot( }) .not.toBe(null); - const recoveryKey = await aliceBotClient.getRecoveryKey(); + const recoveryKey = await botClient.getRecoveryKey(); - return { aliceBotClient, recoveryKey, expectedBackupVersion }; + return { botClient, recoveryKey, expectedBackupVersion }; } /**