fix(GRO-1366): add non-null assertion to removeButtons[0]
Fix TypeScript error on line 114: HTMLElement | undefined is not assignable to Element. Added ! assertion since length guard already excludes the empty-array case. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -111,7 +111,7 @@ describe("PetForm", () => {
|
||||
render(<PetForm pet={petWithAlert} onSave={onSave} onCancel={onCancel} />);
|
||||
const removeButtons = screen.getAllByRole("button", { name: "" });
|
||||
if (removeButtons.length === 0) return;
|
||||
const removeButton = removeButtons[0];
|
||||
const removeButton = removeButtons[0]!;
|
||||
if (!removeButton) return;
|
||||
fireEvent.click(removeButton);
|
||||
expect(screen.queryByText("Allergic to chicken")).toBeNull();
|
||||
|
||||
Reference in New Issue
Block a user