diff --git a/frontend/src/components/LoginModal.tsx b/frontend/src/components/LoginButtonModal.tsx similarity index 94% rename from frontend/src/components/LoginModal.tsx rename to frontend/src/components/LoginButtonModal.tsx index 7d3649575..ae3ef0430 100644 --- a/frontend/src/components/LoginModal.tsx +++ b/frontend/src/components/LoginButtonModal.tsx @@ -11,14 +11,14 @@ import { import { USWDSIcon } from "src/components/USWDSIcon"; -const LOGIN_URL = "/api/auth/login"; +export const LOGIN_URL = "/api/auth/login"; -export const LoginModal = ({ +export const LoginButtonModal = ({ navLoginLinkText, }: { navLoginLinkText: string; }) => { - const t = useTranslations("LoginModal"); + const t = useTranslations("LoginButtonModal"); const modalRef = useRef(null); return ( diff --git a/frontend/src/components/user/UserControl.tsx b/frontend/src/components/user/UserControl.tsx index d26113617..b0b8135f0 100644 --- a/frontend/src/components/user/UserControl.tsx +++ b/frontend/src/components/user/UserControl.tsx @@ -10,7 +10,7 @@ import { NavDropDownButton, } from "@trussworks/react-uswds"; -import { LoginModal } from "src/components/LoginModal"; +import { LoginButtonModal } from "src/components/LoginButtonModal"; import { USWDSIcon } from "src/components/USWDSIcon"; // used in three different places @@ -116,7 +116,9 @@ export const UserControl = () => { return ( <> - {!user?.token && } + {!user?.token && ( + + )} {!!user?.token && ( ({ }), })); -describe("LoginModal", () => { +describe("LoginButtonModal", () => { it("renders", () => { - render(); + render(); const loginGovLink = screen.getByRole("link", { name: /Sign in with Login.gov/i, }); expect(loginGovLink).toBeInTheDocument(); + expect(loginGovLink).toHaveAttribute("href", LOGIN_URL); + const modalTitle = screen.getByRole("heading", { level: 2 }); expect(modalTitle).toHaveTextContent("Sign in to Simpler.Grants.gov"); });