mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
fix(panel): KB playbooks category, LLM-health diagnostic, scorecard tab, feature-flags 2-col + X creds dropdown; fix(a2a): publish live event from direct send path; fix(docker): orchestrator Node 22 (#305)
Co-authored-by: Renn F <rennf93@users.noreply.github.com>
This commit is contained in:
@@ -12,7 +12,7 @@ vi.mock("@/lib/api", () => ({
|
||||
xApi: { getCredentialsStatus, setCredentials },
|
||||
}));
|
||||
|
||||
import { XCredentialsCard } from "../x-credentials-card";
|
||||
import { XCredentialsForm } from "../x-credentials-card";
|
||||
|
||||
function withQueryClient(ui: ReactNode) {
|
||||
const client = new QueryClient({
|
||||
@@ -21,7 +21,7 @@ function withQueryClient(ui: ReactNode) {
|
||||
return <QueryClientProvider client={client}>{ui}</QueryClientProvider>;
|
||||
}
|
||||
|
||||
describe("XCredentialsCard", () => {
|
||||
describe("XCredentialsForm", () => {
|
||||
beforeEach(() => {
|
||||
getCredentialsStatus.mockClear();
|
||||
setCredentials.mockClear();
|
||||
@@ -31,14 +31,14 @@ describe("XCredentialsCard", () => {
|
||||
});
|
||||
|
||||
it("shows 'no credentials configured' by default and never renders a secret", async () => {
|
||||
render(withQueryClient(<XCredentialsCard />));
|
||||
render(withQueryClient(<XCredentialsForm />));
|
||||
expect(
|
||||
await screen.findByText("No credentials configured"),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("disables Save until all 4 fields are filled", async () => {
|
||||
render(withQueryClient(<XCredentialsCard />));
|
||||
render(withQueryClient(<XCredentialsForm />));
|
||||
await screen.findByText("No credentials configured");
|
||||
const saveButton = screen.getByRole("button", { name: "Save" });
|
||||
expect(saveButton).toBeDisabled();
|
||||
@@ -61,7 +61,7 @@ describe("XCredentialsCard", () => {
|
||||
});
|
||||
|
||||
it("saves all 4 secrets and clears the inputs on success", async () => {
|
||||
render(withQueryClient(<XCredentialsCard />));
|
||||
render(withQueryClient(<XCredentialsForm />));
|
||||
await screen.findByText("No credentials configured");
|
||||
|
||||
fireEvent.change(screen.getByLabelText("API key"), {
|
||||
|
||||
Reference in New Issue
Block a user