From 51e97862d3adf1594f024f0da39a87592a0732c0 Mon Sep 17 00:00:00 2001 From: Jeesun Kim Date: Tue, 9 Apr 2024 11:33:05 -0700 Subject: [PATCH] update tests --- tests/createAccountPage.test.ts | 8 ++------ tests/createMuxedAccountPage.test.ts | 12 ++++++++---- tests/parseMuxedAccountPage.test.ts | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/createAccountPage.test.ts b/tests/createAccountPage.test.ts index e85ae724..5d90696a 100644 --- a/tests/createAccountPage.test.ts +++ b/tests/createAccountPage.test.ts @@ -21,12 +21,8 @@ test.describe("Create Account Page", () => { test("Test 'Generate keypair' button", async ({ page }) => { await page.getByRole("button", { name: "Generate keypair" }).click(); - await expect( - page.locator("input[id='generate-keypair-publickey']"), - ).toHaveValue(/^G/); - await expect( - page.locator("input[id='generate-keypair-secretkey']"), - ).toHaveValue(/^S/); + await expect(page.locator("#generate-keypair-publickey")).toHaveValue(/^G/); + await expect(page.locator("#generate-keypair-secretkey")).toHaveValue(/^S/); }); test("Test 'Fund account' button", async ({ page }) => { diff --git a/tests/createMuxedAccountPage.test.ts b/tests/createMuxedAccountPage.test.ts index f289fefe..cd16dcaa 100644 --- a/tests/createMuxedAccountPage.test.ts +++ b/tests/createMuxedAccountPage.test.ts @@ -63,10 +63,14 @@ test.describe("Create Muxed Account Page", () => { await expect(page.getByTestId("createAccount-success")).toBeVisible(); - const muxedValue = page.locator("input[id='muxed-account-address-result']"); - const muxedAccount = new MuxedAccount(new Account(publicKey, "0"), muxedId); - - await expect(muxedValue).toHaveValue(muxedAccount.accountId()); + const baseAddressFromMuxedAccount = MuxedAccount.fromAddress( + muxedAccount.accountId(), + "0", + ) + .baseAccount() + .accountId(); + + expect(baseAddressFromMuxedAccount).toEqual(publicKey); }); }); diff --git a/tests/parseMuxedAccountPage.test.ts b/tests/parseMuxedAccountPage.test.ts index 9bd27e50..012cf26b 100644 --- a/tests/parseMuxedAccountPage.test.ts +++ b/tests/parseMuxedAccountPage.test.ts @@ -12,7 +12,7 @@ test.describe("Parse Muxed Account Page", () => { }); test("Renders 'Muxed Account M Address' input field", async ({ page }) => { - expect(page.locator("input[id='muxed-account-address']")).toBeVisible; + expect(page.locator("#muxed-account-address")).toBeVisible; }); test("Gets an error with an invalid muxed account key in 'Muxed Account M Address' field", async ({