diff --git a/packages/uniforms/__tests__/AutoForm.tsx b/packages/uniforms/__tests__/AutoForm.tsx index bcb5905c5..0d7d34b0b 100644 --- a/packages/uniforms/__tests__/AutoForm.tsx +++ b/packages/uniforms/__tests__/AutoForm.tsx @@ -104,7 +104,7 @@ describe('', () => { describe('when render', () => { it('calls `onChange` before render', () => { - const field = () => null; + const field = jest.fn(() => null); const Field = connectField(field); // @ts-expect-error Convoluted AutoForm types @@ -119,18 +119,14 @@ describe('', () => { } render( - // @ts-expect-error Convoluted AutoForm types - , + // @ts-expect-error JSX element type 'CustomAutoForm' does not have any construct or call signatures.ts(2604) + , ); expect(onChange).toHaveBeenCalledTimes(2); expect(onChange.mock.calls[0]).toEqual(expect.arrayContaining(['b', ''])); expect(onChange.mock.calls[1]).toEqual(expect.arrayContaining(['c', ''])); + expect(field).toHaveBeenCalled(); }); it('skips `onSubmit` until rendered (`autosave` = true)', async () => {