mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
Fixed tests
no refs
This commit is contained in:
parent
6f88adf4b4
commit
07f1d6d3a5
@ -30,12 +30,13 @@ describe('Account Plan Page', () => {
|
||||
|
||||
test('can choose plan and continue', async () => {
|
||||
const {mockOnActionFn, monthlyCheckboxEl, yearlyCheckboxEl, continueBtn} = setup();
|
||||
fireEvent.click(monthlyCheckboxEl);
|
||||
expect(monthlyCheckboxEl.checked).toEqual(true);
|
||||
fireEvent.click(yearlyCheckboxEl);
|
||||
expect(yearlyCheckboxEl.checked).toEqual(true);
|
||||
expect(continueBtn).toBeEnabled();
|
||||
|
||||
fireEvent.click(continueBtn);
|
||||
expect(mockOnActionFn).toHaveBeenCalledWith('checkoutPlan', {plan: '6086d2c776909b1a2382369a'});
|
||||
expect(mockOnActionFn).toHaveBeenCalledWith('checkoutPlan', {plan: '6087c314d3e64b3266bf715e'});
|
||||
});
|
||||
});
|
||||
|
@ -49,7 +49,7 @@ const prices = [
|
||||
stripe_product_id: 'prod_JNGGBrrogUXcoM',
|
||||
active: 1,
|
||||
nickname: 'Yearly',
|
||||
currency: 'aud',
|
||||
currency: 'usd',
|
||||
amount: 12200,
|
||||
type: 'recurring',
|
||||
interval: 'year'
|
||||
@ -108,7 +108,7 @@ export const site = {
|
||||
description: 'The default product'
|
||||
},
|
||||
prices: prices,
|
||||
allow_self_signup: false,
|
||||
allow_self_signup: true,
|
||||
members_signup_access: 'all',
|
||||
free_price_name: 'Free',
|
||||
free_price_description: 'Free preview',
|
||||
@ -265,5 +265,6 @@ export const member = {
|
||||
|
||||
export const testSite = {
|
||||
...site,
|
||||
portal_plans: ['free', 'monthly', 'yearly']
|
||||
allow_self_signup: true,
|
||||
portal_plans: ['free', ...priceIds]
|
||||
};
|
||||
|
@ -238,6 +238,7 @@ export function getSitePrices({site = {}, includeFree = true, pageQuery = ''} =
|
||||
freePriceCurrencyDetail.currency = stripePrices[0].currency;
|
||||
freePriceCurrencyDetail.currency_symbol = stripePrices[0].currency_symbol;
|
||||
}
|
||||
|
||||
if (allowSelfSignup && portalPlans.includes('free') && includeFree) {
|
||||
plansData.push({
|
||||
id: 'free',
|
||||
|
@ -38,4 +38,4 @@ const customRender = (ui, {options = {}, overrideContext = {}} = {}) => {
|
||||
export * from '@testing-library/react';
|
||||
|
||||
// override render method
|
||||
export {customRender as render};
|
||||
export {customRender as render};
|
||||
|
Loading…
Reference in New Issue
Block a user