Found in the browser check: change-password history rows had no browser or IP, settings errors named internal fields, and the dialog's new password field read just "Password". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
16 lines
731 B
TypeScript
16 lines
731 B
TypeScript
import { describe, it, expect, vi } from "vitest";
|
|
import { render, screen } from "@testing-library/react";
|
|
|
|
vi.mock("@/app/lib/i18n/MessagesProvider", () => ({ useT: () => (k: string) => k }));
|
|
vi.mock("@/app/lib/services/adminUsers", () => ({ changeOwnPassword: vi.fn() }));
|
|
|
|
import ChangePasswordDialog from "./ChangePasswordDialog";
|
|
|
|
describe("ChangePasswordDialog labels", () => {
|
|
it("labels the new password field as the new password", () => {
|
|
render(<ChangePasswordDialog onClose={() => {}} onDone={() => {}} />);
|
|
expect(screen.getByLabelText("PwdNew")).toHaveAttribute("autocomplete", "new-password");
|
|
expect(screen.getByLabelText("PwdCurrent")).toHaveAttribute("autocomplete", "current-password");
|
|
});
|
|
});
|