Skip to content

Commit

Permalink
update tests to use a string instead of regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeesun Kim authored and Jeesun Kim committed Apr 4, 2024
1 parent 689040a commit 60dfcea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions tests/createMuxedAccountPage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test.describe("Create Muxed Account Page", () => {

await expect(publicKeyInput).toHaveAttribute("aria-invalid", "true");
await expect(
page.getByText(/Base account address should start with G/),
page.getByText("Base account address should start with G"),
).toBeVisible();
});

Expand All @@ -38,7 +38,7 @@ test.describe("Create Muxed Account Page", () => {
await muxedAccountIdInput.fill("XLKDSFJLSKDJF");

await expect(muxedAccountIdInput).toHaveAttribute("aria-invalid", "true");
await expect(page.getByText(/Expected a whole number/)).toBeVisible();
await expect(page.getByText("Expected a whole number")).toBeVisible();
});

test("Successfully creates a muxed account", async ({ page }) => {
Expand All @@ -47,9 +47,8 @@ test.describe("Create Muxed Account Page", () => {
const publicKeyInput = page.locator("#muxed-public-key");
await publicKeyInput.fill(publicKey);

const muxedAccountIdInput = page.locator("#muxed-account-iD");
const fakeWholeNumber = Math.floor(Math.random() * 10000);
await muxedAccountIdInput.fill(`${fakeWholeNumber}`);
const muxedAccountIdInput = page.locator("#muxed-account-id");
await muxedAccountIdInput.fill("2");

const createButton = page.getByRole("button").getByText("Create");

Expand Down
2 changes: 1 addition & 1 deletion tests/parseMuxedAccountPage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ test.describe("Parse Muxed Account Page", () => {

await expect(publicKeyInput).toHaveAttribute("aria-invalid", "true");
await expect(
page.getByText(/Muxed account address should start with M/),
page.getByText("Muxed account address should start with M"),
).toBeVisible();
});
});

0 comments on commit 60dfcea

Please sign in to comment.