fix(ui): remove auth card theme toggle

This commit is contained in:
Hugo P.Brito committed 2026-07-16 13:10:22 +01:00
1 parent 641a11e4a0
commit 459902175d
2 files changed
+31 -7

No files matched your search

@@ -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: () => <button type="button">Auth card theme toggle</button>,
}));
describe("AuthLayout", () => {
it("renders the auth card title and content without the theme toggle", () => {
// Given
const title = "Sign in to Prowler";
// When
render(
<AuthLayout title={title}>
<form aria-label="Sign in form">Form content</form>
</AuthLayout>,
);
// 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();
});
});
+2 -7
View File
@@ -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 */}
<div className="border-border-neutral-secondary dark:bg-bg-neutral-primary/85 relative z-10 flex w-full max-w-sm flex-col gap-4 rounded-[14px] border bg-white/90 px-8 py-10 shadow-sm md:max-w-md">
{/* Header with Title and Theme Toggle */}
<div className="flex items-center justify-between">
<p className="pb-2 text-xl font-medium">{title}</p>
<ThemeSwitch aria-label="Toggle theme" />
</div>
{/* Header */}
<p className="pb-2 text-xl font-medium">{title}</p>
{/* Content */}
{children}