Skip to content

Commit

Permalink
Wait for account response
Browse files Browse the repository at this point in the history
  • Loading branch information
quietbits committed Dec 2, 2024
1 parent 72338b7 commit 982c6ba
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/savedKeypairs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,15 @@ test.describe("Saved Keypairs Page", () => {
);

// Wait for the Friendbot response
const responsePromise = pageContext.waitForResponse(
const friendbotResponse = pageContext.waitForResponse(
(response) =>
response.url().includes("?addr=") && response.status() === 200,
response.url().includes(`?addr=${SAVED_ACCOUNT_2}`) &&
response.status() === 200,
);

await fundButton.click();

await responsePromise;
await friendbotResponse;

// Mock Account 2 response
await pageContext.route(
Expand All @@ -139,6 +140,14 @@ test.describe("Saved Keypairs Page", () => {
},
);

const accountResponse = pageContext.waitForResponse(
(response) =>
response.url().includes(`accounts/${SAVED_ACCOUNT_2}`) &&
response.status() === 200,
);

await accountResponse;

await expect(fundButton).toBeHidden();
await expect(
keypairItem.getByText("Balance: 10000.0000000 XLM", { exact: true }),
Expand Down

0 comments on commit 982c6ba

Please sign in to comment.