diff --git a/src/form.tsx b/src/form.tsx index 88ac851..53080a1 100644 --- a/src/form.tsx +++ b/src/form.tsx @@ -61,7 +61,7 @@ export interface FormProps { /** * Callback that is called whenever an attribute is changed */ - onChange?: (context: ReturnType["getContextValue"]>) => void; + onChange?: (context: ReturnType["getContextValue"]>, attribute: string) => void; /** * * TODO(ade): sort out prop with children @@ -193,7 +193,7 @@ export class Form> extends React.Component { }); expect(onChange).toHaveBeenCalled(); + expect(onChange).toBeCalledWith(expect.objectContaining({ formState: { "test-input": "A" } }), "test-input"); });