refactor(data): replace schema classes with readonly models
This commit is contained in:
@@ -2,12 +2,12 @@ import { act } from "react";
|
||||
import { createRoot, type Root } from "react-dom/client";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
import { PaymentPlan } from "@/data/schemas/payment";
|
||||
import { PaymentPlan, PaymentPlanSchema } from "@/data/schemas/payment";
|
||||
import { behaviorAnalytics } from "@/lib/analytics";
|
||||
|
||||
import { usePaymentPlanAnalytics } from "../use-payment-plan-analytics";
|
||||
|
||||
const firstPlan = PaymentPlan.from({
|
||||
const firstPlan = PaymentPlanSchema.parse({
|
||||
planId: "plan-1",
|
||||
planName: "Plan One",
|
||||
orderType: "dol",
|
||||
@@ -18,7 +18,7 @@ const firstPlan = PaymentPlan.from({
|
||||
originalAmountCents: null,
|
||||
currency: "USD",
|
||||
});
|
||||
const secondPlan = PaymentPlan.from({
|
||||
const secondPlan = PaymentPlanSchema.parse({
|
||||
planId: "plan-2",
|
||||
planName: "Plan Two",
|
||||
orderType: "dol",
|
||||
@@ -43,8 +43,9 @@ describe("usePaymentPlanAnalytics", () => {
|
||||
let root: Root;
|
||||
|
||||
beforeEach(() => {
|
||||
(globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean })
|
||||
.IS_REACT_ACT_ENVIRONMENT = true;
|
||||
(
|
||||
globalThis as { IS_REACT_ACT_ENVIRONMENT?: boolean }
|
||||
).IS_REACT_ACT_ENVIRONMENT = true;
|
||||
container = document.createElement("div");
|
||||
document.body.appendChild(container);
|
||||
root = createRoot(container);
|
||||
|
||||
Reference in New Issue
Block a user