diff --git a/apps/smart-ssh-community/frontend/src/components/AiProviderSettings.test.tsx b/apps/smart-ssh-community/frontend/src/components/AiProviderSettings.test.tsx index 26cf26fed..a1eee6897 100644 --- a/apps/smart-ssh-community/frontend/src/components/AiProviderSettings.test.tsx +++ b/apps/smart-ssh-community/frontend/src/components/AiProviderSettings.test.tsx @@ -231,7 +231,9 @@ describe("AiProviderSettings credentials test button (Spec 0050, Teil 3)", () => screen.getByRole("button", { name: "Zugangsdaten testen" }), ); - expect(await screen.findByText("Zugangsdaten gültig")).toBeInTheDocument(); + const valid = await screen.findByText("Zugangsdaten gültig"); + expect(valid).toBeInTheDocument(); + expect(valid.querySelector("svg")?.getAttribute("data-icon")).toBe("check"); expect(testAiProviderCredentials).toHaveBeenCalledWith( expect.objectContaining({ apiKey: "sk-abc" }), ); @@ -250,7 +252,9 @@ describe("AiProviderSettings credentials test button (Spec 0050, Teil 3)", () => screen.getByRole("button", { name: "Zugangsdaten testen" }), ); - expect(await screen.findByText("Authentifizierung fehlgeschlagen – API-Key prüfen")).toBeInTheDocument(); + const failed = await screen.findByText("Authentifizierung fehlgeschlagen – API-Key prüfen"); + expect(failed).toBeInTheDocument(); + expect(failed.querySelector("svg")?.getAttribute("data-icon")).toBe("x"); }); it("shows an unreachable result including the message", async () => { diff --git a/apps/smart-ssh-community/frontend/src/components/TestResultBadge.test.tsx b/apps/smart-ssh-community/frontend/src/components/TestResultBadge.test.tsx index c787d04cd..eccdb5d5f 100644 --- a/apps/smart-ssh-community/frontend/src/components/TestResultBadge.test.tsx +++ b/apps/smart-ssh-community/frontend/src/components/TestResultBadge.test.tsx @@ -73,4 +73,16 @@ describe("TestResultBadge (Spec 0069, Teil A5)", () => { expect(screen.getByText("Verbindung erfolgreich")).toBeInTheDocument(); }); + + it("renders the check icon for the success state", () => { + const { container } = renderBadge({ kind: "success" }); + + expect(container.querySelector("svg")?.getAttribute("data-icon")).toBe("check"); + }); + + it("renders the x icon for the failure state", () => { + const { container } = renderBadge({ kind: "authenticationFailed" }); + + expect(container.querySelector("svg")?.getAttribute("data-icon")).toBe("x"); + }); });