diff options
| author | Adam Soltys <[email protected]> | 2026-03-01 21:09:04 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-03-01 21:09:04 -0800 |
| commit | cbbd98ae5446b11f2a432dee7ffea291cdf2ee21 (patch) | |
| tree | a397fe8afa5527cf9d86e4fd854d69d8f56fabfe /test | |
| parent | c7e2383736d3ef99f069226bbafad9fbddfeb030 (diff) | |
| download | coinos-ui-cbbd98ae5446b11f2a432dee7ffea291cdf2ee21.tar.gz coinos-ui-cbbd98ae5446b11f2a432dee7ffea291cdf2ee21.zip | |
messages
Diffstat (limited to 'test')
| -rw-r--r-- | test/e2e/dm-subscribe.spec.ts | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/test/e2e/dm-subscribe.spec.ts b/test/e2e/dm-subscribe.spec.ts index 70fbae76..abc7c293 100644 --- a/test/e2e/dm-subscribe.spec.ts +++ b/test/e2e/dm-subscribe.spec.ts @@ -1,13 +1,21 @@ import { expect, test } from "@playwright/test"; -import { login, bobUsername, bobPassword, aliceUsername, alicePassword } from "./helpers"; +import { login, bobUsername, bobPassword, aliceUsername, alicePassword, apiBaseUrl } from "./helpers"; test("recipient receives DM via relay subscription in real-time", async ({ browser }) => { test.setTimeout(60_000); - // --- Set up Alice (recipient) --- + // --- Resolve pubkeys from usernames --- const aliceContext = await browser.newContext(); const alicePage = await aliceContext.newPage(); + const [aliceRes, bobRes] = await Promise.all([ + alicePage.request.get(`${apiBaseUrl}/users/${aliceUsername}`), + alicePage.request.get(`${apiBaseUrl}/users/${bobUsername}`), + ]); + const alicePubkey = (await aliceRes.json()).pubkey; + const bobPubkey = (await bobRes.json()).pubkey; + + // --- Set up Alice (recipient) --- const aliceConsole: string[] = []; alicePage.on("console", (msg) => aliceConsole.push(`[${msg.type()}] ${msg.text()}`)); @@ -25,7 +33,7 @@ test("recipient receives DM via relay subscription in real-time", async ({ brows }); await login(alicePage, aliceUsername, alicePassword); - await alicePage.goto(`/dm?username=${bobUsername}`); + await alicePage.goto(`/messages/${bobPubkey}`); await alicePage.waitForLoadState("domcontentloaded"); const aliceTextarea = alicePage.locator("#message-contents"); @@ -70,7 +78,7 @@ test("recipient receives DM via relay subscription in real-time", async ({ brows }); await login(bobPage, bobUsername, bobPassword); - await bobPage.goto(`/dm?username=${aliceUsername}`); + await bobPage.goto(`/messages/${alicePubkey}`); await bobPage.waitForLoadState("domcontentloaded"); const bobTextarea = bobPage.locator("#message-contents"); |
