Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix: Add client test for sidebar notification badge URL (#12411)

Max Deichmann8fd1da4f22a9
diff --git a/web/src/components/nav/sidebar-notifications.clienttest.tsx b/web/src/components/nav/sidebar-notifications.clienttest.tsx
new file mode 100644
index 0000000000..01325f994f
--- /dev/null
+++ b/web/src/components/nav/sidebar-notifications.clienttest.tsx
@@ -0,0 +1,19 @@
+import { render, screen } from "@testing-library/react";
+import { SidebarNotifications } from "./sidebar-notifications";
+
+jest.mock("../useLocalStorage", () => ({
+ __esModule: true,
+ default: () => [[], jest.fn()],
+}));
+
+describe("SidebarNotifications", () => {
+ it("renders the GitHub stars badge with social style query params", () => {
+ render(<SidebarNotifications />);
+
+ const badge = screen.getByAltText("Langfuse GitHub stars");
+ const src = badge.getAttribute("src");
+
+ expect(src).toContain("style=social");
+ expect(src).not.toContain("&amp;");
+ });
+});
diff --git a/web/src/components/nav/sidebar-notifications.tsx b/web/src/components/nav/sidebar-notifications.tsx
index 0fe69d9c5f..b82e460748 100644
--- a/web/src/components/nav/sidebar-notifications.tsx
+++ b/web/src/components/nav/sidebar-notifications.tsx
@@ -37,7 +37,7 @@ const notifications: SidebarNotification[] = [
// eslint-disable-next-line @next/next/no-img-element
<img
alt="Langfuse GitHub stars"
- src="https://img.shields.io/github/stars/langfuse/langfuse?label=langfuse&amp;style=social"
+ src="https://img.shields.io/github/stars/langfuse/langfuse?label=langfuse&style=social"
/>
),
},