Route landing account sign-ins to checkout
This commit is contained in:
@@ -11,6 +11,14 @@ export function runTests() {
|
||||
const accountCenter = fs.readFileSync(path.join(accountDir, "AccountCenter.tsx"), "utf8");
|
||||
const paymentFlow = fs.readFileSync(path.join(accountDir, "usePaymentFlow.ts"), "utf8");
|
||||
const accountPayment = fs.readFileSync(path.join(accountDir, "useAccountPayment.ts"), "utf8");
|
||||
const landingPage = fs.readFileSync(
|
||||
path.join(projectRoot, "components", "landing", "InstitutionalLandingPage.tsx"),
|
||||
"utf8",
|
||||
);
|
||||
const landingAuthActions = fs.readFileSync(
|
||||
path.join(projectRoot, "components", "landing", "LandingAuthActions.tsx"),
|
||||
"utf8",
|
||||
);
|
||||
const productAccess = fs.readFileSync(
|
||||
path.join(projectRoot, "components", "dashboard", "scan-terminal", "ProductAccessRequired.tsx"),
|
||||
"utf8",
|
||||
@@ -30,6 +38,19 @@ export function runTests() {
|
||||
"account page must support /account?checkout=1 for direct upgrade entry",
|
||||
);
|
||||
|
||||
assert(
|
||||
accountCenter.includes('href="/auth/login?next=%2Faccount%3Fcheckout%3D1"'),
|
||||
"account page sign-in button must preserve the checkout entry for unauthenticated subscription recovery",
|
||||
);
|
||||
|
||||
assert(
|
||||
landingAuthActions.includes('href="/account?checkout=1"') &&
|
||||
landingPage.includes('href="/account?checkout=1"') &&
|
||||
!/href="\/account"(?![/?#])/.test(landingAuthActions) &&
|
||||
!/href="\/account"(?![/?#])/.test(landingPage),
|
||||
"landing subscription/account CTAs must open the checkout account entry instead of a generic account page",
|
||||
);
|
||||
|
||||
assert(
|
||||
productAccess.includes('href="/account?checkout=1"') &&
|
||||
productAccess.includes("Renew and restore access") &&
|
||||
|
||||
Reference in New Issue
Block a user