From 459902175d633959088e0ea1cdee18b04d230338 Mon Sep 17 00:00:00 2001 From: "Hugo P.Brito" Date: Thu, 16 Jul 2026 13:10:22 +0100 Subject: [PATCH] fix(ui): remove auth card theme toggle --- ui/components/auth/oss/auth-layout.test.tsx | 29 +++++++++++++++++++++ ui/components/auth/oss/auth-layout.tsx | 9 ++----- 2 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 ui/components/auth/oss/auth-layout.test.tsx diff --git a/ui/components/auth/oss/auth-layout.test.tsx b/ui/components/auth/oss/auth-layout.test.tsx new file mode 100644 index 0000000000..608bdece88 --- /dev/null +++ b/ui/components/auth/oss/auth-layout.test.tsx @@ -0,0 +1,29 @@ +import { render, screen } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; + +import { AuthLayout } from "./auth-layout"; + +vi.mock("@/components/ThemeSwitch", () => ({ + ThemeSwitch: () => , +})); + +describe("AuthLayout", () => { + it("renders the auth card title and content without the theme toggle", () => { + // Given + const title = "Sign in to Prowler"; + + // When + render( + +
Form content
+
, + ); + + // Then + expect(screen.getByText(title)).toBeVisible(); + expect(screen.getByRole("form", { name: "Sign in form" })).toBeVisible(); + expect( + screen.queryByRole("button", { name: "Auth card theme toggle" }), + ).not.toBeInTheDocument(); + }); +}); diff --git a/ui/components/auth/oss/auth-layout.tsx b/ui/components/auth/oss/auth-layout.tsx index 6d90c28844..1d0962262e 100644 --- a/ui/components/auth/oss/auth-layout.tsx +++ b/ui/components/auth/oss/auth-layout.tsx @@ -1,7 +1,5 @@ import { ReactNode } from "react"; -import { ThemeSwitch } from "@/components/ThemeSwitch"; - interface AuthLayoutProps { title: string; children: ReactNode; @@ -22,11 +20,8 @@ export const AuthLayout = ({ title, children }: AuthLayoutProps) => { {/* Auth Form Container */}
- {/* Header with Title and Theme Toggle */} -
-

{title}

- -
+ {/* Header */} +

{title}

{/* Content */} {children}