Updated donations browser tests for new default suggested value

ref https://github.com/TryGhost/Ghost/pull/20793

- now that there's a non-zero suggested value amount Stripe's UI shows a button to change the amount rather than showing the amount input field immediately
- added extra click to the tests and an expectation that the default value is set correctly
This commit is contained in:
Kevin Ansfield 2024-08-20 12:34:33 +01:00
parent 0b3f7d7705
commit d3c2c7b369

View File

@ -8,6 +8,9 @@ test.describe('Portal', () => {
// go to website and open portal
await sharedPage.goto('/#/portal/support');
const totalAmount = sharedPage.getByTestId('product-summary-total-amount');
await expect(totalAmount).toHaveText('$5.00');
await sharedPage.getByText('Change amount').click();
await sharedPage.locator('#customUnitAmount').fill('12.50');
await sharedPage.locator('#email').fill('member-donation-test-1@ghost.org');
await completeStripeSubscription(sharedPage);
@ -34,6 +37,7 @@ test.describe('Portal', () => {
await sharedPage.goto('#/portal/support');
// Don't need to fill email as it's already filled
await sharedPage.getByText('Change amount').click();
await sharedPage.locator('#customUnitAmount').fill('12.50');
await completeStripeSubscription(sharedPage);