mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Fixed tests
no refs Updated tests to work with custom prices
This commit is contained in:
parent
53b63acf40
commit
a7de8e9c47
4 changed files with 16 additions and 4 deletions
|
@ -36,6 +36,6 @@ describe('Account Plan Page', () => {
|
|||
expect(continueBtn).toBeEnabled();
|
||||
|
||||
fireEvent.click(continueBtn);
|
||||
expect(mockOnActionFn).toHaveBeenCalledWith('checkoutPlan', {plan: 'Monthly'});
|
||||
expect(mockOnActionFn).toHaveBeenCalledWith('checkoutPlan', {plan: '6086d2c776909b1a2382369a'});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -39,7 +39,7 @@ describe('SignupPage', () => {
|
|||
const {nameInput, emailInput, submitButton, mockOnActionFn} = setup();
|
||||
const nameVal = 'J Smith';
|
||||
const emailVal = 'jsmith@example.com';
|
||||
const planVal = 'Free';
|
||||
const planVal = 'free';
|
||||
|
||||
fireEvent.change(nameInput, {target: {value: nameVal}});
|
||||
fireEvent.change(emailInput, {target: {value: emailVal}});
|
||||
|
|
|
@ -228,6 +228,19 @@ export const member = {
|
|||
amount: 500,
|
||||
currency: 'USD'
|
||||
},
|
||||
price: {
|
||||
id: 'price_1IkXgCFToJelIqAsTP3V1paQ',
|
||||
nickname: 'Yearly',
|
||||
amount: 500,
|
||||
interval: 'year',
|
||||
type: 'recurring',
|
||||
currency: 'USD',
|
||||
product: {
|
||||
id: 'prod_JNGGBrrogUXcoM',
|
||||
name: 'Main Product',
|
||||
product_id: '6086cd1b27c7d417b4a18eaf'
|
||||
}
|
||||
},
|
||||
status: 'active',
|
||||
start_date: '2019-05-01T11:42:40.000Z',
|
||||
default_payment_card_last4: '4242',
|
||||
|
@ -240,5 +253,5 @@ export const member = {
|
|||
|
||||
export const testSite = {
|
||||
...site,
|
||||
portal_plans: ['free', 'monthly', 'yearly']
|
||||
portal_plans: ['free', '6086d2c776909b1a2382369a', '6086eff0823dd7240afc8083']
|
||||
};
|
||||
|
|
|
@ -133,7 +133,6 @@ export function getSitePrices({site = {}, includeFree = true, pageQuery} = {}) {
|
|||
return {
|
||||
...d,
|
||||
price_id: d.id,
|
||||
id: d.stripe_price_id,
|
||||
price: d.amount / 100,
|
||||
name: d.nickname,
|
||||
currency_symbol: getCurrencySymbol(d.currency)
|
||||
|
|
Loading…
Add table
Reference in a new issue