feat(contribution): port accept-invite.vue to ContributionAmountField
Replace cadence radios, contribution input, preset chips, guidance label, and billing summary block with a single ContributionAmountField usage. Default contribution updated to 180 to preserve the previous $15/mo suggested annual default (cadence-unit value now). Updated flowSummary to format cadence-unit directly. Updated e2e selectors to use the data-testids the component exposes and new summary copy.
This commit is contained in:
parent
3126ddb8ea
commit
e0e7da5cca
2 changed files with 29 additions and 181 deletions
|
|
@ -66,9 +66,9 @@ test.describe('Accept Invite — pre-registrant signup', () => {
|
|||
await expect(page.locator('#circle-community')).toBeAttached()
|
||||
await expect(page.locator('#circle-founder')).toBeAttached()
|
||||
await expect(page.locator('#circle-practitioner')).toBeAttached()
|
||||
await expect(page.locator('#accept-cadence-monthly')).toBeAttached()
|
||||
await expect(page.locator('#accept-cadence-annual')).toBeAttached()
|
||||
await expect(page.locator('#accept-contribution')).toBeVisible()
|
||||
await expect(page.getByTestId('cadence-monthly')).toBeVisible()
|
||||
await expect(page.getByTestId('cadence-annual')).toBeVisible()
|
||||
await expect(page.getByTestId('contribution-amount')).toBeVisible()
|
||||
await expect(page.locator('.contribution-preset-chip').first()).toBeVisible()
|
||||
await expect(page.locator('.form-submit')).toBeVisible()
|
||||
})
|
||||
|
|
@ -110,15 +110,17 @@ test.describe('Accept Invite — pre-registrant signup', () => {
|
|||
await mockVerifyOk(page)
|
||||
await gotoAcceptInvite(page)
|
||||
|
||||
await expect(page.locator('#accept-contribution')).toBeVisible()
|
||||
await page.locator('#accept-contribution').fill('10')
|
||||
await expect(page.getByTestId('contribution-amount')).toBeVisible()
|
||||
await page.getByTestId('cadence-monthly').click()
|
||||
await page.getByTestId('contribution-amount').fill('10')
|
||||
|
||||
await page.locator('label[for="accept-cadence-monthly"]').click()
|
||||
await expect(page.locator('.billing-summary')).toContainText('$10 today')
|
||||
const summary = page.locator('.billing-summary')
|
||||
await expect(summary).toContainText('$10 today')
|
||||
await expect(summary).toContainText('each month')
|
||||
|
||||
await page.locator('label[for="accept-cadence-annual"]').click()
|
||||
await expect(page.locator('.billing-summary')).toContainText('$120 today')
|
||||
await expect(page.locator('.billing-summary')).toContainText('$10/month')
|
||||
await page.getByTestId('cadence-annual').click()
|
||||
await expect(summary).toContainText('$120 today')
|
||||
await expect(summary).toContainText('at each annual renewal')
|
||||
})
|
||||
|
||||
test('preset chip sets contribution amount', async ({ page }) => {
|
||||
|
|
@ -131,7 +133,7 @@ test.describe('Accept Invite — pre-registrant signup', () => {
|
|||
const expected = chipText.replace(/[^0-9]/g, '')
|
||||
|
||||
await chip.click()
|
||||
await expect(page.locator('#accept-contribution')).toHaveValue(expected)
|
||||
await expect(page.getByTestId('contribution-amount')).toHaveValue(expected)
|
||||
})
|
||||
|
||||
test('free tier happy path shows welcome state', async ({ page }) => {
|
||||
|
|
@ -141,7 +143,7 @@ test.describe('Accept Invite — pre-registrant signup', () => {
|
|||
|
||||
await expect(page.locator('#accept-name')).toHaveValue('Free Tester')
|
||||
await page.locator('#circle-community').check({ force: true })
|
||||
await page.locator('#accept-contribution').fill('0')
|
||||
await page.getByTestId('contribution-amount').fill('0')
|
||||
await page.getByRole('checkbox', { name: /Community Guidelines/ }).check()
|
||||
|
||||
await expect(page.locator('.form-submit')).toBeEnabled()
|
||||
|
|
@ -158,7 +160,7 @@ test.describe('Accept Invite — pre-registrant signup', () => {
|
|||
await mockVerifyOk(page)
|
||||
await gotoAcceptInvite(page)
|
||||
|
||||
await page.locator('#accept-contribution').fill('10')
|
||||
await page.getByTestId('contribution-amount').fill('10')
|
||||
await page.getByRole('checkbox', { name: /Community Guidelines/ }).check()
|
||||
await expect(page.locator('.form-submit')).toContainText(/Continue to Payment/)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue