Reorganize repo structure and standards references
This commit is contained in:
1 parent
3cb93a81be
commit
be2054274d
5885 files changed
+2588
-195
No files matched your search
+16
@@ -0,0 +1,16 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { subscriptionCheckoutPath, subscriptionRequiredCheckoutPath } from "./SubscriptionUrlUtils";
|
||||
|
||||
describe("subscription URL helpers", () => {
|
||||
it("builds canonical public checkout routes", () => {
|
||||
expect(subscriptionCheckoutPath("acme")).toBe("/subscribe/acme");
|
||||
expect(subscriptionCheckoutPath("acme", "{CHECKOUT_SESSION_ID}/success")).toBe("/subscribe/acme/{CHECKOUT_SESSION_ID}/success");
|
||||
expect(subscriptionRequiredCheckoutPath("acme")).toBe("/subscribe/acme?error=subscription_required");
|
||||
});
|
||||
|
||||
it("encodes tenant slugs as one route segment", () => {
|
||||
expect(subscriptionCheckoutPath(" Acme Team/West ")).toBe("/subscribe/Acme%20Team%2FWest");
|
||||
expect(() => subscriptionCheckoutPath(" ")).toThrow("tenantSlug is required");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user