Files
zitadel/apps/login/src/components/username-form.test.tsx
T
RamonandGitHub 057fb8dff2 fix(login): prettier setup (#11798)
# Which Problems Are Solved
Invalid formatting in the login codebase due to invalid prettier
configuration

# How the Problems Are Solved
Fxed .prettierignore wildcards for login source files

# Additional Changes
Removed .prettierrc file because there is already a prettier.config.mjs
file

# Additional Context
2026-03-10 13:30:20 +00:00

27 lines
768 B
TypeScript

import { cleanup, render } from "@testing-library/react";
import { afterEach, describe, expect, test, vi } from "vitest";
import { UsernameForm } from "./username-form";
vi.mock("next/navigation", () => ({
useRouter: () => ({ push: vi.fn() }),
}));
vi.mock("next-intl", () => ({
useTranslations: () => (key: string) => key,
}));
vi.mock("@/lib/server/loginname", () => ({
sendLoginname: vi.fn(),
}));
describe("UsernameForm", () => {
afterEach(cleanup);
test("should autofocus the loginName input on mount", () => {
const { getByTestId } = render(
<UsernameForm loginName="" requestId={undefined} loginSettings={undefined} submit={false} allowRegister={false} />,
);
expect(getByTestId("username-text-input")).toHaveFocus();
});
});