add test for user-project offers on front page

This commit is contained in:
2024-11-05 05:50:15 -07:00
parent 195ba6c759
commit f96c5892e7
2 changed files with 14 additions and 0 deletions

View File

@@ -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();
});

View File

@@ -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();