Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions e2e/tests/admin-assumption.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ test.describe("Admin Identity Assumption", () => {
});

// Verify the expense is visible on the regular user's dashboard
await expect(page.getByText("User Expense")).toBeVisible();
await expect(page.getByText("$75.00").first()).toBeVisible();
const regularUserRecentExpenses = page
.getByText("Recent Expenses")
.locator('xpath=ancestor::*[@data-slot="card"][1]');
await expect(regularUserRecentExpenses.getByText("User Expense")).toBeVisible();
await expect(regularUserRecentExpenses.getByText("$75.00")).toBeVisible();

// Log out the regular user
await page.getByRole("button", { name: "Logout" }).click();
Expand Down Expand Up @@ -52,8 +55,11 @@ test.describe("Admin Identity Assumption", () => {

// Step 5: Verify we're now viewing the regular user's dashboard
await expect(page).toHaveURL(/\/dashboard/);
await expect(page.getByText("User Expense")).toBeVisible();
await expect(page.getByText("$75.00").first()).toBeVisible();
const assumedUserRecentExpenses = page
.getByText("Recent Expenses")
.locator('xpath=ancestor::*[@data-slot="card"][1]');
await expect(assumedUserRecentExpenses.getByText("User Expense")).toBeVisible();
await expect(assumedUserRecentExpenses.getByText("$75.00")).toBeVisible();

// The "Return to Admin" floating button should be visible
const returnButton = page.getByRole("button", {
Expand Down
7 changes: 5 additions & 2 deletions e2e/tests/mobile-expense.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ test.describe("Mobile Expense Logging", () => {
await page.waitForURL("**/dashboard");

// Step 3: Verify the expense appears on the dashboard
await expect(page.getByText("Mobile Coffee")).toBeVisible();
await expect(page.getByText("$5.50").first()).toBeVisible();
const recentExpenses = page
.getByText("Recent Expenses")
.locator('xpath=ancestor::*[@data-slot="card"][1]');
await expect(recentExpenses.getByText("Mobile Coffee")).toBeVisible();
await expect(recentExpenses.getByText("$5.50")).toBeVisible();

// Step 4: Navigate to expense log via mobile menu
await page.getByRole("button", { name: "Open menu" }).click();
Expand Down
7 changes: 5 additions & 2 deletions e2e/tests/registration-onboarding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ test.describe("Registration → Onboarding → First Expense", () => {

// Step 5: Verify the dashboard reflects the new expense
// Recent expenses section should show the expense
await expect(page.getByText("Grocery Shopping")).toBeVisible();
await expect(page.getByText("$42.50").first()).toBeVisible();
const recentExpenses = page
.getByText("Recent Expenses")
.locator('xpath=ancestor::*[@data-slot="card"][1]');
await expect(recentExpenses.getByText("Grocery Shopping")).toBeVisible();
await expect(recentExpenses.getByText("$42.50")).toBeVisible();

// Total Spent should update
await expect(page.getByText("Total Spent")).toBeVisible();
Expand Down
Loading
Loading