mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-20 22:11:02 -06:00
chore: move js sdk and demo app to its own repository (#5668)
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
"use client";
|
||||
|
||||
import { formbricksLogout } from "@/app/lib/formbricks";
|
||||
import { signOut } from "next-auth/react";
|
||||
import { useEffect } from "react";
|
||||
|
||||
export const ClientLogout = () => {
|
||||
useEffect(() => {
|
||||
formbricksLogout();
|
||||
signOut();
|
||||
});
|
||||
return null;
|
||||
|
||||
@@ -27,8 +27,6 @@ vi.mock("@/lib/constants", () => ({
|
||||
WEBAPP_URL: "test-webapp-url",
|
||||
IS_PRODUCTION: false,
|
||||
SENTRY_DSN: "mock-sentry-dsn",
|
||||
FORMBRICKS_API_HOST: "test-formbricks-api-host",
|
||||
FORMBRICKS_ENVIRONMENT_ID: "test-formbricks-environment-id",
|
||||
IS_FORMBRICKS_ENABLED: true,
|
||||
}));
|
||||
|
||||
@@ -36,13 +34,6 @@ vi.mock("@/lib/constants", () => ({
|
||||
vi.mock("@/app/(app)/environments/[environmentId]/components/ResponseFilterContext", () => ({
|
||||
ResponseFilterProvider: ({ children }: any) => <div data-testid="ResponseFilterProvider">{children}</div>,
|
||||
}));
|
||||
vi.mock("@/app/(app)/components/FormbricksClient", () => ({
|
||||
FormbricksClient: ({ userId, email }: any) => (
|
||||
<div data-testid="FormbricksClient">
|
||||
{userId}-{email}
|
||||
</div>
|
||||
),
|
||||
}));
|
||||
vi.mock("@/modules/ui/components/toaster-client", () => ({
|
||||
ToasterClient: () => <div data-testid="ToasterClient" />,
|
||||
}));
|
||||
@@ -69,7 +60,6 @@ describe("EnvironmentIdBaseLayout", () => {
|
||||
|
||||
expect(screen.getByTestId("ResponseFilterProvider")).toBeInTheDocument();
|
||||
expect(screen.getByTestId("PosthogIdentify")).toHaveTextContent("org1");
|
||||
expect(screen.getByTestId("FormbricksClient")).toHaveTextContent("user1-user1@example.com");
|
||||
expect(screen.getByTestId("ToasterClient")).toBeInTheDocument();
|
||||
expect(screen.getByTestId("child")).toHaveTextContent("Test Content");
|
||||
});
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
import { FormbricksClient } from "@/app/(app)/components/FormbricksClient";
|
||||
import { PosthogIdentify } from "@/app/(app)/environments/[environmentId]/components/PosthogIdentify";
|
||||
import { ResponseFilterProvider } from "@/app/(app)/environments/[environmentId]/components/ResponseFilterContext";
|
||||
import {
|
||||
FORMBRICKS_API_HOST,
|
||||
FORMBRICKS_ENVIRONMENT_ID,
|
||||
IS_FORMBRICKS_ENABLED,
|
||||
IS_POSTHOG_CONFIGURED,
|
||||
} from "@/lib/constants";
|
||||
import { IS_POSTHOG_CONFIGURED } from "@/lib/constants";
|
||||
import { ToasterClient } from "@/modules/ui/components/toaster-client";
|
||||
import { Session } from "next-auth";
|
||||
import { TOrganization } from "@formbricks/types/organizations";
|
||||
@@ -38,13 +32,6 @@ export const EnvironmentIdBaseLayout = async ({
|
||||
organizationBilling={organization.billing}
|
||||
isPosthogEnabled={IS_POSTHOG_CONFIGURED}
|
||||
/>
|
||||
<FormbricksClient
|
||||
userId={user.id}
|
||||
email={user.email}
|
||||
formbricksApiHost={FORMBRICKS_API_HOST}
|
||||
formbricksEnvironmentId={FORMBRICKS_ENVIRONMENT_ID}
|
||||
formbricksEnabled={IS_FORMBRICKS_ENABLED}
|
||||
/>
|
||||
<ToasterClient />
|
||||
{children}
|
||||
</ResponseFilterProvider>
|
||||
|
||||
Reference in New Issue
Block a user