Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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" }),
);
Expand All @@ -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 () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
Loading