Files
co-lite/solvway-admin-portal/app/components/app/ChangePasswordDialog.labels.test.tsx
T
ngqileandClaude Opus 5.5 dd9bbbe036 fix: browser context on password-change history, plain settings errors, New password label
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
2026-11-30 14:52:15 +08:00

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");
});
});