feat(analytics): add behavior and payment funnel tracking
This commit is contained in:
@@ -33,6 +33,27 @@ describe("navigation resolver", () => {
|
||||
).toBe("/subscription?type=topup");
|
||||
});
|
||||
|
||||
it("preserves payment analytics context through auth redirects", () => {
|
||||
const subscriptionUrl = ROUTE_BUILDERS.subscription("topup", {
|
||||
payChannel: "stripe",
|
||||
returnTo: "chat",
|
||||
analytics: {
|
||||
entryPoint: "chat_unlock",
|
||||
triggerReason: "ad_landing",
|
||||
},
|
||||
});
|
||||
|
||||
expect(subscriptionUrl).toBe(
|
||||
"/subscription?type=topup&payChannel=stripe&returnTo=chat&analytics_entry=chat_unlock&analytics_reason=ad_landing",
|
||||
);
|
||||
expect(
|
||||
resolveAuthenticatedNavigation({
|
||||
loginStatus: "guest",
|
||||
targetUrl: subscriptionUrl,
|
||||
}),
|
||||
).toBe(ROUTE_BUILDERS.authWithRedirect(subscriptionUrl));
|
||||
});
|
||||
|
||||
it("allows not logged in users to enter chat for guest bootstrap", () => {
|
||||
expect(
|
||||
resolveRouteGuardRedirect({
|
||||
|
||||
Reference in New Issue
Block a user