diff --git a/apps/web/src/components/dashboard/WidgetContainer.test.tsx b/apps/web/src/components/dashboard/WidgetContainer.test.tsx new file mode 100644 index 0000000..616417c --- /dev/null +++ b/apps/web/src/components/dashboard/WidgetContainer.test.tsx @@ -0,0 +1,39 @@ +import React from "react"; +import { renderToStaticMarkup } from "react-dom/server"; +import { describe, expect, it, vi } from "vitest"; +import { WidgetContainer } from "./WidgetContainer.js"; + +vi.mock("framer-motion", () => ({ + motion: { + div: ({ children, className }: { children: React.ReactNode; className?: string }) => ( +
{description}
diff --git a/apps/web/src/components/dashboard/widgets/PeakTimesWidget.test.tsx b/apps/web/src/components/dashboard/widgets/PeakTimesWidget.test.tsx new file mode 100644 index 0000000..d147c9a --- /dev/null +++ b/apps/web/src/components/dashboard/widgets/PeakTimesWidget.test.tsx @@ -0,0 +1,105 @@ +import React from "react"; +import { renderToStaticMarkup } from "react-dom/server"; +import { describe, expect, it, vi } from "vitest"; +import { PeakTimesWidget } from "./PeakTimesWidget.js"; + +const { useQueryMock } = vi.hoisted(() => ({ + useQueryMock: vi.fn(), +})); + +vi.mock("next/dynamic", () => ({ + default: () => () =>