small details
This commit is contained in:
parent
61ae2807de
commit
86c92a7c65
11 changed files with 328 additions and 184 deletions
|
|
@ -148,6 +148,44 @@ test.describe("Exchange Page - Regular User Access", () => {
|
|||
timeout: 10000,
|
||||
});
|
||||
});
|
||||
|
||||
test("summary card displays correct text for buy and sell directions", async ({ page }) => {
|
||||
await page.goto("/exchange");
|
||||
await expect(page.getByRole("heading", { name: "Exchange Bitcoin" })).toBeVisible();
|
||||
|
||||
// Wait for price data to load
|
||||
await expect(page.getByText("Market:")).toBeVisible({ timeout: 5000 });
|
||||
|
||||
// Test BUY direction summary
|
||||
const buyButton = page.getByRole("button", { name: "Buy BTC" });
|
||||
await buyButton.click();
|
||||
|
||||
// Wait for summary to update
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Check that summary contains "You pay" and "you receive" with EUR amount and sats
|
||||
const summaryElement = page.getByTestId("trade-summary");
|
||||
await expect(summaryElement).toBeVisible({ timeout: 5000 });
|
||||
const summaryText = await summaryElement.textContent();
|
||||
expect(summaryText).toContain("You pay");
|
||||
expect(summaryText).toContain("you receive");
|
||||
expect(summaryText).toMatch(/€\s*\d+/); // Should contain EUR amount
|
||||
expect(summaryText).toMatch(/\d+\s*sats/); // Should contain sats amount
|
||||
|
||||
// Test SELL direction summary
|
||||
const sellButton = page.getByRole("button", { name: "Sell BTC" });
|
||||
await sellButton.click();
|
||||
|
||||
// Wait for summary to update
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
// Check that summary contains "You pay" and "you receive" with sats and EUR amount
|
||||
const summaryTextSell = await summaryElement.textContent();
|
||||
expect(summaryTextSell).toContain("You pay");
|
||||
expect(summaryTextSell).toContain("you receive");
|
||||
expect(summaryTextSell).toMatch(/€\s*\d+/); // Should contain EUR amount
|
||||
expect(summaryTextSell).toMatch(/\d+\s*sats/); // Should contain sats amount
|
||||
});
|
||||
});
|
||||
|
||||
test.describe("Exchange Page - With Availability", () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue