mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-22 06:00:51 -06:00
Compare commits
8 Commits
fix-broken
...
integratio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec051c0de0 | ||
|
|
d0c9af8e67 | ||
|
|
92cc5eaae4 | ||
|
|
ca31d1c3e8 | ||
|
|
e4df544634 | ||
|
|
bdd2d611d2 | ||
|
|
af95d0c3dc | ||
|
|
2dcf675fbe |
@@ -111,8 +111,7 @@ export default async function handle(req: NextApiRequest, res: NextApiResponse)
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "Langfuse",
|
name: "Langfuse",
|
||||||
description:
|
description: "Open source LLM engineering platform. Debug, analyze and iterate together.",
|
||||||
"Open source LLM engineering platform. Debug, analyze and iterate together.",
|
|
||||||
href: "https://langfuse.com",
|
href: "https://langfuse.com",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
|
|
||||||
import base from "../../packages/tailwind-config/tailwind.config";
|
import base from "../../packages/tailwind-config/tailwind.config";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import { cn } from "@formbricks/lib/cn";
|
|
||||||
import { PresentationChartLineIcon, InboxStackIcon } from "@heroicons/react/24/solid";
|
|
||||||
import Link from "next/link";
|
|
||||||
import revalidateSurveyIdPath from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/actions";
|
import revalidateSurveyIdPath from "@/app/(app)/environments/[environmentId]/surveys/[surveyId]/(analysis)/actions";
|
||||||
|
import { InboxStackIcon, PresentationChartLineIcon } from "@heroicons/react/24/solid";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
|
import { cn } from "@formbricks/lib/cn";
|
||||||
|
|
||||||
interface SurveyResultsTabProps {
|
interface SurveyResultsTabProps {
|
||||||
activeId: string;
|
activeId: string;
|
||||||
|
|||||||
@@ -1,11 +1,13 @@
|
|||||||
"use server";
|
"use server";
|
||||||
import { createTag } from "@formbricks/lib/tag/service";
|
|
||||||
import { addTagToRespone, deleteTagOnResponse } from "@formbricks/lib/tagOnResponse/service";
|
|
||||||
import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth";
|
|
||||||
import { authOptions } from "@formbricks/lib/authOptions";
|
|
||||||
import { getServerSession } from "next-auth";
|
import { getServerSession } from "next-auth";
|
||||||
import { AuthorizationError } from "@formbricks/types/errors";
|
|
||||||
|
import { authOptions } from "@formbricks/lib/authOptions";
|
||||||
|
import { hasUserEnvironmentAccess } from "@formbricks/lib/environment/auth";
|
||||||
|
import { createTag } from "@formbricks/lib/tag/service";
|
||||||
import { canUserAccessTagOnResponse } from "@formbricks/lib/tagOnResponse/auth";
|
import { canUserAccessTagOnResponse } from "@formbricks/lib/tagOnResponse/auth";
|
||||||
|
import { addTagToRespone, deleteTagOnResponse } from "@formbricks/lib/tagOnResponse/service";
|
||||||
|
import { AuthorizationError } from "@formbricks/types/errors";
|
||||||
|
|
||||||
export const createTagAction = async (environmentId: string, tagName: string) => {
|
export const createTagAction = async (environmentId: string, tagName: string) => {
|
||||||
const session = await getServerSession(authOptions);
|
const session = await getServerSession(authOptions);
|
||||||
|
|||||||
@@ -73,5 +73,8 @@
|
|||||||
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/tests/__mocks__/fileMock.js",
|
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/tests/__mocks__/fileMock.js",
|
||||||
"\\.(css|less)$": "<rootDir>/tests/__mocks__/styleMock.js"
|
"\\.(css|less)$": "<rootDir>/tests/__mocks__/styleMock.js"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"puppeteer": "^21.3.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
30
packages/js/tests/formbricks-integration.test.ts
Normal file
30
packages/js/tests/formbricks-integration.test.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
// formbricks-integration.test.js
|
||||||
|
|
||||||
|
const puppeteer = require("puppeteer");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
let browser;
|
||||||
|
let page;
|
||||||
|
|
||||||
|
beforeAll(async () => {
|
||||||
|
browser = await puppeteer.launch({ headless: "old" });
|
||||||
|
page = await browser.newPage();
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(async () => {
|
||||||
|
await browser.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("formbricks integration test", () => {
|
||||||
|
it("should load formbricks successfully", async () => {
|
||||||
|
await page.goto(`file://${path.resolve(__dirname, "./test.html")}`);
|
||||||
|
const isFormbricksLoaded = await page.waitForFunction(
|
||||||
|
() => {
|
||||||
|
return window.formbricks !== undefined;
|
||||||
|
},
|
||||||
|
{ timeout: 10000 }
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(isFormbricksLoaded).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
23
packages/js/tests/test.html
Normal file
23
packages/js/tests/test.html
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>FormBricks Integration Test</title>
|
||||||
|
<script src="path-to-formbricks.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>This is A TEST</h1>
|
||||||
|
|
||||||
|
<!-- Load formbricks-js package -->
|
||||||
|
<script src="../dist/index.umd.js"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
// Wait for the DOM to be fully loaded before initializing FormBricks
|
||||||
|
window.formbricks.init({
|
||||||
|
environmentId: "clj0zabr40009ma0hs7bb4cq9",
|
||||||
|
apiHost: "https://app.formbricks.com",
|
||||||
|
debug: true
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
20795
pnpm-lock.yaml
generated
20795
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user