0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-01 02:41:39 -05:00

Added paid member with selected tier fixture

This commit is contained in:
Rishabh 2022-03-11 20:10:22 +05:30
parent 389163c338
commit c5154a43a7
3 changed files with 33 additions and 3 deletions

View file

@ -19,7 +19,8 @@ const DEV_MODE_DATA = {
showPopup: true,
site: Fixtures.site,
member: Fixtures.member.paid,
page: 'signup',
page: 'accountHome',
...Fixtures.paidMemberOnTier(),
pageData: Fixtures.offer
};

View file

@ -257,6 +257,7 @@ export function getSubscriptionData({
amount = (interval === 'month' ? 500 : 5000),
nickname = (interval === 'month' ? 'Monthly' : 'Yearly'),
cardLast4 = '4242',
offer: localOffer = offer,
priceId: price_id = `price_${objectId()}`,
startDate: start_date = '2021-10-05T03:18:30.000Z',
currentPeriodEnd: current_period_end = '2022-10-05T03:18:30.000Z',
@ -276,7 +277,7 @@ export function getSubscriptionData({
interval,
currency
},
offer,
offer: localOffer,
status,
start_date,
default_payment_card_last4: cardLast4,

View file

@ -39,7 +39,7 @@ const products = [
}),
numOfBenefits: 1
})
// ,
// getProductData({
// name: 'Friends of the Blueprint',
@ -144,4 +144,32 @@ export const member = {
]
})
};
export function paidMemberOnTier() {
let price = site?.products?.[2].monthlyPrice;
/* eslint-disable no-console */
console.log(site?.products);
console.log('price', price);
let updatedMember = getMemberData({
paid: true,
subscriptions: [
getSubscriptionData({
offer: null,
priceId: price?.id,
status: 'active',
currency: price?.currency,
interval: price?.interval,
amount: price?.amount,
cardLast4: '4242',
startDate: '2021-10-05T03:18:30.000Z',
currentPeriodEnd: '2022-10-05T03:18:30.000Z',
cancelAtPeriodEnd: false
})
]
});
return {
site,
member: updatedMember
};
}
/* eslint-enable no-unused-vars*/