Added Playwright check that Offer redemption count was incremented

refs https://github.com/TryGhost/Team/issues/2369

- this checks whether the Offer redemption count is set to 1, which
  would be indicative that the Offer was successfully counted as
  redeemed
This commit is contained in:
Daniel Lockyer 2022-12-07 16:52:58 +07:00
parent 464504a8e1
commit 1e27dd638f
No known key found for this signature in database

View File

@ -38,6 +38,11 @@ test.describe('Portal', () => {
// 1 member, should be Testy, on Portal Tier
await expect(page.getByRole('link', {name: 'Testy McTesterson testy@example.com'}), 'Should have 1 paid member').toBeVisible();
await expect(page.getByRole('link', {name: tierName}), `Paid member should be on ${tierName}`).toBeVisible();
// Ensure the offer redemption count was bumped
await page.locator('.gh-nav a[href="#/offers/"]').click();
const locator = page.locator('.gh-offers-list > tr:nth-child(2) > a > span').last();
await expect(locator).toContainText('1');
});
test('Creates and uses a discount Offer', async ({page}) => {