Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeesun Kim authored and Jeesun Kim committed Apr 9, 2024
1 parent 74c2526 commit 51e9786
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 2 additions & 6 deletions tests/createAccountPage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) => {
Expand Down
12 changes: 8 additions & 4 deletions tests/createMuxedAccountPage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
2 changes: 1 addition & 1 deletion tests/parseMuxedAccountPage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 ({
Expand Down

0 comments on commit 51e9786

Please sign in to comment.