test: validate custom answers only after a submit attempt

This commit is contained in:
scotttong committed 2026-10-27 21:57:24 -07:00
1 parent 80e65114d6
commit 441b35fd0d
1 file changed
+3
@@ -949,6 +949,9 @@ describe("TaskChatProtocolCard", () => {
container.querySelectorAll<HTMLButtonElement>("button"),
).find((button) => button.getAttribute("aria-label") === "Next question");
expect(next?.disabled).toBe(false);
expect(container.textContent).not.toContain("Enter a custom answer.");
const submitNext = Array.from(container.querySelectorAll("button")).find(button => button.textContent?.trim() === "Next");
await act(async () => submitNext?.click());
expect(container.textContent).toContain("Enter a custom answer.");
const textarea = container.querySelector("textarea")!;