[PM-40544] Default sales and marketing trials to 14 days (#24430)

* feat(billing): default sales and marketing trial length to 14 days

* feat(billing): use the 14-day default in sales and marketing trial copy
This commit is contained in:
Stephon Brown
2026-11-11 14:21:35 -05:00
committed by GitHub
parent 6b8ce54785
commit 8bb9d5b08b
5 changed files with 12 additions and 8 deletions

View File

@@ -1 +1,5 @@
/** Default trial length for in-product signups and premium upgrades. */
export const DEFAULT_TRIAL_LENGTH_DAYS = 7;
/** Trial length for sales-initiated and marketing trials, used when the trial link omits an explicit length. */
export const MARKETING_SALES_TRIAL_LENGTH_DAYS = 14;

View File

@@ -116,12 +116,12 @@ describe("CompleteTrialInitiationComponent", () => {
expect(component.trialLength).toBe(7);
});
it("should default trialLength to 7 when not provided", async () => {
it("should default trialLength to 14 when not provided", async () => {
mockActivatedRoute.queryParams.next({
product: ProductType.PasswordManager,
productTier: ProductTierType.Enterprise,
});
expect(component.trialLength).toBe(7);
expect(component.trialLength).toBe(14);
});
it("should read salesAssistedToken from query params", async () => {

View File

@@ -3,7 +3,7 @@ import { ActivatedRouteSnapshot, ResolveFn } from "@angular/router";
import { ProductType } from "@bitwarden/common/billing/enums";
import { Translation } from "@bitwarden/components";
import { DEFAULT_TRIAL_LENGTH_DAYS } from "../../../constants";
import { MARKETING_SALES_TRIAL_LENGTH_DAYS } from "../../../constants";
export const freeTrialTextResolver: ResolveFn<Translation | null> = (
route: ActivatedRouteSnapshot,
@@ -13,7 +13,7 @@ export const freeTrialTextResolver: ResolveFn<Translation | null> = (
const trialLength = route.queryParams.trialLength
? parseInt(route.queryParams.trialLength)
: DEFAULT_TRIAL_LENGTH_DAYS;
: MARKETING_SALES_TRIAL_LENGTH_DAYS;
const onlyPasswordManager = products.length === 1 && products[0] === ProductType.PasswordManager;
const onlySecretsManager = products.length === 1 && products[0] === ProductType.SecretsManager;

View File

@@ -1,5 +1,5 @@
import { ProductTierType, ProductType } from "@bitwarden/common/billing/enums";
import { DEFAULT_TRIAL_LENGTH_DAYS } from "@bitwarden/web-vault/app/billing/constants";
import { MARKETING_SALES_TRIAL_LENGTH_DAYS } from "@bitwarden/web-vault/app/billing/constants";
import { parseTrialInitiationParams } from "./trial-initiation-params";
@@ -80,7 +80,7 @@ describe("parseTrialInitiationParams", () => {
});
it("defaults the trial length and preserves an explicit zero", () => {
expect(parseTrialInitiationParams({}).trialLength).toBe(DEFAULT_TRIAL_LENGTH_DAYS);
expect(parseTrialInitiationParams({}).trialLength).toBe(MARKETING_SALES_TRIAL_LENGTH_DAYS);
expect(parseTrialInitiationParams({ trialLength: "0" }).trialLength).toBe(0);
expect(parseTrialInitiationParams({ trialLength: "14" }).trialLength).toBe(14);
});

View File

@@ -1,7 +1,7 @@
import { Params } from "@angular/router";
import { ProductTierType, ProductType } from "@bitwarden/common/billing/enums";
import { DEFAULT_TRIAL_LENGTH_DAYS } from "@bitwarden/web-vault/app/billing/constants";
import { MARKETING_SALES_TRIAL_LENGTH_DAYS } from "@bitwarden/web-vault/app/billing/constants";
/** Products a trial link can request. */
const trialProducts: ProductType[] = [
@@ -59,7 +59,7 @@ export function parseTrialInitiationParams(queryParams: Params): TrialInitiation
product: baseProduct(products),
privilegedControlsRequested: products.includes(ProductType.PrivilegedControls),
productTier: toOptionalInt(queryParams.productTier) as ProductTierType | undefined,
trialLength: toOptionalInt(queryParams.trialLength) ?? DEFAULT_TRIAL_LENGTH_DAYS,
trialLength: toOptionalInt(queryParams.trialLength) ?? MARKETING_SALES_TRIAL_LENGTH_DAYS,
paymentOptional: queryParams.paymentOptional === "true",
sponsorshipToken: queryParams.sponsorshipToken ?? undefined,
};