mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-22 19:39:01 -05:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a50cd9f861 | |||
| b1b94eaa66 | |||
| 67cc96449d | |||
| bf41a53b86 | |||
| 656b7a0f66 | |||
| 26292ecf39 |
@@ -89,7 +89,7 @@ jobs:
|
|||||||
- check-latest-release
|
- check-latest-release
|
||||||
with:
|
with:
|
||||||
IS_PRERELEASE: ${{ github.event.release.prerelease }}
|
IS_PRERELEASE: ${{ github.event.release.prerelease }}
|
||||||
MAKE_LATEST: ${{ needs.check-latest-release.outputs.is_latest == 'true' }}
|
MAKE_LATEST: ${{ needs.check-latest-release.outputs.is_latest }}
|
||||||
|
|
||||||
docker-build-cloud:
|
docker-build-cloud:
|
||||||
name: Build & push Formbricks Cloud to ECR
|
name: Build & push Formbricks Cloud to ECR
|
||||||
@@ -101,7 +101,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
image_tag: ${{ needs.docker-build-community.outputs.VERSION }}
|
image_tag: ${{ needs.docker-build-community.outputs.VERSION }}
|
||||||
IS_PRERELEASE: ${{ github.event.release.prerelease }}
|
IS_PRERELEASE: ${{ github.event.release.prerelease }}
|
||||||
MAKE_LATEST: ${{ needs.check-latest-release.outputs.is_latest == 'true' }}
|
MAKE_LATEST: ${{ needs.check-latest-release.outputs.is_latest }}
|
||||||
needs:
|
needs:
|
||||||
- check-latest-release
|
- check-latest-release
|
||||||
- docker-build-community
|
- docker-build-community
|
||||||
@@ -154,4 +154,4 @@ jobs:
|
|||||||
release_tag: ${{ github.event.release.tag_name }}
|
release_tag: ${{ github.event.release.tag_name }}
|
||||||
commit_sha: ${{ github.sha }}
|
commit_sha: ${{ github.sha }}
|
||||||
is_prerelease: ${{ github.event.release.prerelease }}
|
is_prerelease: ${{ github.event.release.prerelease }}
|
||||||
make_latest: ${{ needs.check-latest-release.outputs.is_latest == 'true' }}
|
make_latest: ${{ needs.check-latest-release.outputs.is_latest }}
|
||||||
|
|||||||
@@ -85,6 +85,6 @@ export const middleware = async (originalRequest: NextRequest) => {
|
|||||||
|
|
||||||
export const config = {
|
export const config = {
|
||||||
matcher: [
|
matcher: [
|
||||||
"/((?!_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|js|css|images|fonts|icons|public).*)",
|
"/((?!_next/static|_next/image|favicon.ico|sitemap.xml|robots.txt|js|css|images|fonts|icons|public|animated-bgs).*)",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,6 +32,16 @@ vi.mock("@/lib/styling/constants", () => ({
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// Mock recall utility
|
||||||
|
vi.mock("@/lib/utils/recall", () => ({
|
||||||
|
recallToHeadline: vi.fn((headline) => headline),
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Mock text content extraction
|
||||||
|
vi.mock("@formbricks/types/surveys/validation", () => ({
|
||||||
|
getTextContent: vi.fn((text) => text),
|
||||||
|
}));
|
||||||
|
|
||||||
describe("Metadata Utils", () => {
|
describe("Metadata Utils", () => {
|
||||||
// Reset all mocks before each test
|
// Reset all mocks before each test
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -173,6 +183,75 @@ describe("Metadata Utils", () => {
|
|||||||
WEBAPP_URL: "https://test.formbricks.com",
|
WEBAPP_URL: "https://test.formbricks.com",
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("handles welcome card headline with HTML content", async () => {
|
||||||
|
const { getTextContent } = await import("@formbricks/types/surveys/validation");
|
||||||
|
|
||||||
|
const mockSurvey = {
|
||||||
|
id: mockSurveyId,
|
||||||
|
environmentId: mockEnvironmentId,
|
||||||
|
name: "Test Survey",
|
||||||
|
metadata: {},
|
||||||
|
languages: [],
|
||||||
|
welcomeCard: {
|
||||||
|
enabled: true,
|
||||||
|
timeToFinish: false,
|
||||||
|
showResponseCount: false,
|
||||||
|
headline: {
|
||||||
|
default: "<p>Welcome <strong>Headline</strong></p>",
|
||||||
|
},
|
||||||
|
html: {
|
||||||
|
default: "Welcome Description",
|
||||||
|
},
|
||||||
|
} as TSurveyWelcomeCard,
|
||||||
|
} as TSurvey;
|
||||||
|
|
||||||
|
vi.mocked(getSurvey).mockResolvedValue(mockSurvey);
|
||||||
|
vi.mocked(getTextContent).mockReturnValue("Welcome Headline");
|
||||||
|
|
||||||
|
const result = await getBasicSurveyMetadata(mockSurveyId);
|
||||||
|
|
||||||
|
expect(getTextContent).toHaveBeenCalled();
|
||||||
|
expect(result.title).toBe("Welcome Headline");
|
||||||
|
});
|
||||||
|
|
||||||
|
test("handles welcome card headline with recall variables", async () => {
|
||||||
|
const { recallToHeadline } = await import("@/lib/utils/recall");
|
||||||
|
|
||||||
|
const mockSurvey = {
|
||||||
|
id: mockSurveyId,
|
||||||
|
environmentId: mockEnvironmentId,
|
||||||
|
name: "Test Survey",
|
||||||
|
metadata: {},
|
||||||
|
languages: [],
|
||||||
|
welcomeCard: {
|
||||||
|
enabled: true,
|
||||||
|
timeToFinish: false,
|
||||||
|
showResponseCount: false,
|
||||||
|
headline: {
|
||||||
|
default: "Welcome #recall:name/fallback:User#",
|
||||||
|
},
|
||||||
|
html: {
|
||||||
|
default: "Welcome Description",
|
||||||
|
},
|
||||||
|
} as TSurveyWelcomeCard,
|
||||||
|
} as TSurvey;
|
||||||
|
|
||||||
|
vi.mocked(getSurvey).mockResolvedValue(mockSurvey);
|
||||||
|
vi.mocked(recallToHeadline).mockReturnValue({
|
||||||
|
default: "Welcome @User",
|
||||||
|
});
|
||||||
|
|
||||||
|
const result = await getBasicSurveyMetadata(mockSurveyId);
|
||||||
|
|
||||||
|
expect(recallToHeadline).toHaveBeenCalledWith(
|
||||||
|
mockSurvey.welcomeCard.headline,
|
||||||
|
mockSurvey,
|
||||||
|
false,
|
||||||
|
"default"
|
||||||
|
);
|
||||||
|
expect(result.title).toBe("Welcome @User");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("getSurveyOpenGraphMetadata", () => {
|
describe("getSurveyOpenGraphMetadata", () => {
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
"markdown-it": "14.1.0",
|
"markdown-it": "14.1.0",
|
||||||
"mime-types": "3.0.1",
|
"mime-types": "3.0.1",
|
||||||
"next": "15.5.6",
|
"next": "15.5.6",
|
||||||
"next-auth": "4.24.11",
|
"next-auth": "4.24.12",
|
||||||
"next-safe-action": "7.10.8",
|
"next-safe-action": "7.10.8",
|
||||||
"node-fetch": "3.3.2",
|
"node-fetch": "3.3.2",
|
||||||
"nodemailer": "7.0.9",
|
"nodemailer": "7.0.9",
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ When PUBLIC_URL is configured, the following routes are automatically served fro
|
|||||||
- `/fonts/*` - Font files
|
- `/fonts/*` - Font files
|
||||||
- `/icons/*` - Icon assets
|
- `/icons/*` - Icon assets
|
||||||
- `/public/*` - Public static files
|
- `/public/*` - Public static files
|
||||||
|
- `/animated-bgs/*` - Animated Background assets
|
||||||
|
|
||||||
#### Storage Routes
|
#### Storage Routes
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.deployment.securityContext }}
|
{{- if .Values.deployment.securityContext }}
|
||||||
securityContext:
|
securityContext:
|
||||||
{{ toYaml .Values.deployment.securityContext | indent 8 }}
|
{{ toYaml .Values.deployment.securityContext | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds | default 30 }}
|
terminationGracePeriodSeconds: {{ .Values.deployment.terminationGracePeriodSeconds | default 30 }}
|
||||||
containers:
|
containers:
|
||||||
|
|||||||
+1
-1
@@ -79,7 +79,7 @@
|
|||||||
},
|
},
|
||||||
"pnpm": {
|
"pnpm": {
|
||||||
"patchedDependencies": {
|
"patchedDependencies": {
|
||||||
"next-auth@4.24.11": "patches/next-auth@4.24.11.patch"
|
"next-auth@4.24.12": "patches/next-auth@4.24.12.patch"
|
||||||
},
|
},
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"axios": ">=1.12.2",
|
"axios": ">=1.12.2",
|
||||||
|
|||||||
Generated
+2234
-3117
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user