forked from trent_larson/crowd-funder-for-time-pwa
fix test number check that increments
This commit is contained in:
@@ -77,7 +77,17 @@ test('Record an offer', async ({ page }) => {
|
||||
// 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+');
|
||||
// extract the number and check that it's greater than 0 or "50+"
|
||||
const offerNumText = await offerNumElem.textContent();
|
||||
if (offerNumText === null) {
|
||||
throw new Error('Expected Activity Number greater than 0 but got null.');
|
||||
} else if (offerNumText === '50+') {
|
||||
// we're OK
|
||||
} else if (parseInt(offerNumText) > 0) {
|
||||
// we're OK
|
||||
} else {
|
||||
throw new Error(`Expected Activity Number of greater than 0 but got ${offerNumText}.`);
|
||||
}
|
||||
|
||||
// click on the number of new offers to go to the list page
|
||||
await offerNumElem.click();
|
||||
|
||||
Reference in New Issue
Block a user