From f01ddce1f6695baafa1173fff43ecf4e7ca2d54f Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Tue, 5 Nov 2024 05:50:15 -0700 Subject: [PATCH] add test for user-project offers on front page --- test-playwright/50-record-offer.spec.ts | 12 ++++++++++++ test-playwright/60-new-activity.spec.ts | 2 ++ 2 files changed, 14 insertions(+) diff --git a/test-playwright/50-record-offer.spec.ts b/test-playwright/50-record-offer.spec.ts index 8938a65..f7c1d7d 100644 --- a/test-playwright/50-record-offer.spec.ts +++ b/test-playwright/50-record-offer.spec.ts @@ -68,4 +68,16 @@ test('Record an offer', async ({ page }) => { await page.getByTestId('editClaimButton').click(); const newAmount = await page.getByTestId('inputOfferAmount'); await expect(newAmount).toHaveValue((randomNonZeroNumber + 1).toString()); + + // go to the home page and check that the offer is shown as new + await page.goto('./'); + const offerNumElem = page.getByTestId('newOffersToUserProjectsActivityNumber'); + await expect(offerNumElem).toHaveText('50'); + + // click on the number of new offers to go to the list page + await offerNumElem.click(); + await expect(page.getByText('New Offers To Your Projects', { exact: true })).toBeVisible(); + await page.getByTestId('showOffersToUserProjects').click(); + await expect(page.getByText(description)).toBeVisible(); + }); diff --git a/test-playwright/60-new-activity.spec.ts b/test-playwright/60-new-activity.spec.ts index 26e18cb..f1d2b2e 100644 --- a/test-playwright/60-new-activity.spec.ts +++ b/test-playwright/60-new-activity.spec.ts @@ -45,6 +45,8 @@ test('New offers for another user', async ({ page }) => { await page.getByTestId('closeOnboardingAndFinish').click(); let offerNumElem = page.getByTestId('newDirectOffersActivityNumber'); await expect(offerNumElem).toHaveText('2'); + + // click on the number of new offers to go to the list page await offerNumElem.click(); await expect(page.getByText('New Offers To You', { exact: true })).toBeVisible();