144 lines
3.5 KiB
TypeScript
144 lines
3.5 KiB
TypeScript
import type { Page } from '@playwright/test';
|
|
|
|
export const MOCK_PLANS = [
|
|
{
|
|
code: 'LIFETIME_ALL',
|
|
name: 'Lifetime All-Access Plan',
|
|
description: '10 Years access to all modules',
|
|
plan_type: 'bundle',
|
|
billing_period: 'lifetime',
|
|
price_inr: 15000,
|
|
price_usd: 350,
|
|
price_eur: 350,
|
|
is_active: true,
|
|
module_slugs: ['acupuncture-points', 'scalp-acupuncture', 'ear-acupuncture', 'nutrition', 'auriculotherapy', 'gynecological-disorders'],
|
|
modules: [],
|
|
is_featured: true,
|
|
},
|
|
{
|
|
code: 'POINTS_PACK',
|
|
name: 'Points Complete Pack (1 Yr)',
|
|
plan_type: 'bundle',
|
|
billing_period: 'yearly',
|
|
price_inr: 900,
|
|
price_usd: 15,
|
|
price_eur: 15,
|
|
is_active: true,
|
|
module_slugs: ['acupuncture-points', 'scalp-acupuncture', 'ear-acupuncture'],
|
|
},
|
|
{
|
|
code: 'POINTS_ACU',
|
|
name: 'Acu Points Module (1 Yr)',
|
|
plan_type: 'one_time',
|
|
billing_period: 'yearly',
|
|
price_inr: 300,
|
|
price_usd: 5,
|
|
price_eur: 5,
|
|
is_active: true,
|
|
module_slugs: ['acupuncture-points'],
|
|
},
|
|
{
|
|
code: 'POINTS_SCALP',
|
|
name: 'Scalp Points Module (1 Yr)',
|
|
plan_type: 'one_time',
|
|
billing_period: 'yearly',
|
|
price_inr: 100,
|
|
price_usd: 2,
|
|
price_eur: 2,
|
|
is_active: true,
|
|
module_slugs: ['scalp-acupuncture'],
|
|
},
|
|
{
|
|
code: 'POINTS_EAR',
|
|
name: 'Ear Points Module (1 Yr)',
|
|
plan_type: 'one_time',
|
|
billing_period: 'yearly',
|
|
price_inr: 200,
|
|
price_usd: 3,
|
|
price_eur: 3,
|
|
is_active: true,
|
|
module_slugs: ['ear-acupuncture'],
|
|
},
|
|
{
|
|
code: 'PATTERN_CORE',
|
|
name: 'Pattern Module Access (1 Yr)',
|
|
plan_type: 'bundle',
|
|
billing_period: 'yearly',
|
|
price_inr: 500,
|
|
price_usd: 10,
|
|
price_eur: 10,
|
|
is_active: true,
|
|
module_slugs: ['eight-principles'],
|
|
},
|
|
{
|
|
code: 'NUTRITION_CORE',
|
|
name: 'Nutrition Module Access (1 Yr)',
|
|
plan_type: 'bundle',
|
|
billing_period: 'yearly',
|
|
price_inr: 600,
|
|
price_usd: 15,
|
|
price_eur: 15,
|
|
is_active: true,
|
|
module_slugs: ['nutrition'],
|
|
},
|
|
{
|
|
code: 'THERAPEUTICS_GYNAE',
|
|
name: 'Therapeutics: Gynecology (1 Yr)',
|
|
plan_type: 'one_time',
|
|
billing_period: 'yearly',
|
|
price_inr: 600,
|
|
price_usd: 15,
|
|
price_eur: 15,
|
|
is_active: true,
|
|
module_slugs: ['gynecological-disorders'],
|
|
},
|
|
{
|
|
code: 'THERAPEUTICS_EAR',
|
|
name: 'Therapeutics: Ear reflexology (1 Yr)',
|
|
plan_type: 'one_time',
|
|
billing_period: 'yearly',
|
|
price_inr: 600,
|
|
price_usd: 15,
|
|
price_eur: 15,
|
|
is_active: true,
|
|
module_slugs: ['auriculotherapy'],
|
|
},
|
|
{
|
|
code: 'THERAPEUTICS_CORE',
|
|
name: 'Therapeutics Complete Bundle (1 Yr)',
|
|
plan_type: 'bundle',
|
|
billing_period: 'yearly',
|
|
price_inr: 1200,
|
|
price_usd: 30,
|
|
price_eur: 30,
|
|
is_active: true,
|
|
module_slugs: ['gynecological-disorders', 'auriculotherapy'],
|
|
},
|
|
];
|
|
|
|
export async function mockPublicStoreApis(page: Page) {
|
|
await page.route('**/api/checkout/config', async (route) => {
|
|
await route.fulfill({
|
|
status: 200,
|
|
contentType: 'application/json',
|
|
body: JSON.stringify({ razorpay_key_id: 'rzp_test_mock_key' }),
|
|
});
|
|
});
|
|
|
|
await page.route('**/api/plans', async (route) => {
|
|
await route.fulfill({
|
|
status: 200,
|
|
contentType: 'application/json',
|
|
body: JSON.stringify(MOCK_PLANS),
|
|
});
|
|
});
|
|
|
|
await page.route('**/api/contents/modules', async (route) => {
|
|
await route.fulfill({
|
|
status: 200,
|
|
contentType: 'application/json',
|
|
body: JSON.stringify({ modules: [] }),
|
|
});
|
|
});
|
|
}
|