fix(ui): restore auth header controls

This commit is contained in:
Hugo P.Brito committed 2026-07-16 15:38:45 +01:00
1 parent 0057d867f6
commit 73061a8859
2 files changed
+10 -7

No files matched your search

+4 -5
View File
@@ -5,11 +5,13 @@ import { AuthLayout } from "./auth-layout";
import { PublicAuthShell } from "./public-auth-shell";
vi.mock("@/components/ThemeSwitch", () => ({
ThemeSwitch: () => <button type="button">Auth card theme toggle</button>,
ThemeSwitch: ({ "aria-label": ariaLabel }: { "aria-label"?: string }) => (
<button type="button" aria-label={ariaLabel} />
),
}));
describe("AuthLayout", () => {
it("renders the auth card title and content without the theme toggle", () => {
it("renders the auth card title and content", () => {
// Given
const title = "Sign in to Prowler";
@@ -23,9 +25,6 @@ describe("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();
});
it("renders the brand in the centered auth layout flow above the card", () => {
+6 -2
View File
@@ -1,6 +1,7 @@
import { ReactNode } from "react";
import { ProwlerBrand } from "@/components/icons";
import { ThemeSwitch } from "@/components/ThemeSwitch";
interface AuthLayoutProps {
title: string;
@@ -26,8 +27,11 @@ 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 */}
<p className="pb-2 text-xl font-medium">{title}</p>
{/* 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>
{/* Content */}
{children}