feat: expand sudoku analysis and interoperability
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user