Fix typecheck: add null guard for removeButtons[0] in PetForm test
CI / Test (push) Successful in 17s
CI / Lint & Typecheck (push) Failing after 21s
CI / Build & Push Docker Image (push) Has been skipped
CI / Lint & Typecheck (pull_request) Failing after 17s
CI / Test (pull_request) Successful in 1m1s
CI / Build & Push Docker Image (pull_request) Has been skipped

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-20 05:16:14 +00:00
committed by Flea Flicker [agent]
parent 42d1c5cf34
commit 6363465069
+3 -1
View File
@@ -111,7 +111,9 @@ describe("PetForm", () => {
render(<PetForm pet={petWithAlert} onSave={onSave} onCancel={onCancel} />);
const removeButtons = screen.getAllByRole("button", { name: "" });
if (removeButtons.length === 0) return;
fireEvent.click(removeButtons[0]);
const removeButton = removeButtons[0];
if (!removeButton) return;
fireEvent.click(removeButton);
expect(screen.queryByText("Allergic to chicken")).toBeNull();
});