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
@@ -0,0 +1,20 @@
import { fireEvent, render, screen } from "@testing-library/react";
import { describe, expect, it } from "vitest";

import { ConfigGeneratorPanel } from "@/components/site/app-panels/config-generator-panel";

describe("ConfigGeneratorPanel (#6183)", () => {
it("mounts ConfigGeneratorYamlPreview so the generated YAML is visible for an empty form", () => {
render(<ConfigGeneratorPanel />);
expect(screen.getByText("Preview")).toBeTruthy();
expect(screen.getByText(/The exact/)).toBeTruthy();
expect(screen.getAllByText(".loopover.yml").length).toBeGreaterThanOrEqual(2);
expect(screen.getByText(/generated by the config generator/)).toBeTruthy();
});

it("updates the YAML preview when the AI provider mode field group changes formState", () => {
render(<ConfigGeneratorPanel />);
fireEvent.click(screen.getByRole("radio", { name: "consensus" }));
expect(screen.getByText(/combine: consensus/)).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState } from "react";

import { AiProviderModeFieldGroup } from "@/components/site/app-panels/ai-provider-mode-field-group";
import { ConfigGeneratorYamlPreview } from "@/components/site/app-panels/config-generator-yaml-preview";
import { ReesAnalyzerFieldGroup } from "@/components/site/app-panels/rees-analyzer-field-group";
import type { GeneratorFormState } from "@/lib/config-generator-form-state";

Expand All @@ -13,6 +14,7 @@ export function ConfigGeneratorPanel() {
<div className="space-y-6">
<AiProviderModeFieldGroup state={formState} onChange={setFormState} />
<ReesAnalyzerFieldGroup state={formState} onChange={setFormState} />
<ConfigGeneratorYamlPreview formState={formState} />
</div>
);
}
Loading