Compare commits

...

8 Commits

Author SHA1 Message Date
Dhruwang
ec051c0de0 Merge branch 'main' of https://github.com/Dhruwang/formbricks into integration-test 2024-01-08 11:11:00 +05:30
Dhruwang
d0c9af8e67 Merge branch 'main' of https://github.com/Dhruwang/formbricks into integration-test 2023-10-19 10:42:53 +05:30
Dhruwang
92cc5eaae4 added pnpm lock 2023-10-19 10:37:26 +05:30
Dhruwang
ca31d1c3e8 changed package loading approach from CDN to local 2023-10-19 10:36:48 +05:30
Dhruwang
e4df544634 merged main 2023-10-18 18:07:29 +05:30
Dhruwang
bdd2d611d2 made refactors 2023-10-18 09:32:26 +05:30
Dhruwang
af95d0c3dc Merge branch 'main' of https://github.com/Dhruwang/formbricks into integration-test 2023-10-17 19:20:14 +05:30
Dhruwang
2dcf675fbe added integrations test for js package 2023-10-16 13:13:15 +05:30
8 changed files with 14185 additions and 6689 deletions

View File

@@ -111,8 +111,7 @@ export default async function handle(req: NextApiRequest, res: NextApiResponse)
},
{
name: "Langfuse",
description:
"Open source LLM engineering platform. Debug, analyze and iterate together.",
description: "Open source LLM engineering platform. Debug, analyze and iterate together.",
href: "https://langfuse.com",
},
{

View File

@@ -1,5 +1,4 @@
/** @type {import('tailwindcss').Config} */
import base from "../../packages/tailwind-config/tailwind.config";
export default {

View File

@@ -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 { InboxStackIcon, PresentationChartLineIcon } from "@heroicons/react/24/solid";
import Link from "next/link";
import { cn } from "@formbricks/lib/cn";
interface SurveyResultsTabProps {
activeId: string;

View File

@@ -1,11 +1,13 @@
"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 { 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 { addTagToRespone, deleteTagOnResponse } from "@formbricks/lib/tagOnResponse/service";
import { AuthorizationError } from "@formbricks/types/errors";
export const createTagAction = async (environmentId: string, tagName: string) => {
const session = await getServerSession(authOptions);

View File

@@ -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",
"\\.(css|less)$": "<rootDir>/tests/__mocks__/styleMock.js"
}
},
"dependencies": {
"puppeteer": "^21.3.8"
}
}

View 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();
});
});

View 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

File diff suppressed because it is too large Load Diff