feat: expand sudoku analysis and interoperability

This commit is contained in:
2026-08-30 23:21:56 +02:00
parent 4a9869baa0
commit 8ca9300ab3
73 changed files with 12482 additions and 384 deletions
@@ -59,4 +59,42 @@ describe("Sudoku generator workspace", () => {
);
expect(onRate).toHaveBeenCalledOnce();
});
it("submits a bounded evidence-backed practice target", async () => {
const user = userEvent.setup();
const onGenerate = vi.fn();
render(
<GeneratorWorkspace
busy={false}
onGenerate={onGenerate}
onRate={vi.fn()}
/>,
);
await user.selectOptions(
screen.getByLabelText("Practice technique"),
"x-wing",
);
const attempts = screen.getByLabelText("Mining attempts");
await user.clear(attempts);
await user.type(attempts, "7");
await user.clear(screen.getByLabelText("Seed"));
await user.type(screen.getByLabelText("Seed"), "x-wing-training");
await user.click(screen.getByRole("button", { name: "Generate Classic" }));
expect(onGenerate).toHaveBeenCalledWith(
expect.objectContaining({
requiredTechnique: "x-wing",
maxTechniqueAttempts: 7,
seed: "x-wing-training",
}),
);
await user.selectOptions(screen.getByLabelText("Variant"), "killer");
expect(
within(screen.getByLabelText("Practice technique")).getByRole("option", {
name: "Killer Cage",
}),
).toBeInTheDocument();
});
});