Skip to content

Commit

Permalink
Remove leftover autoField property from tests (#1284)
Browse files Browse the repository at this point in the history
  • Loading branch information
kestarumper authored Sep 22, 2023
1 parent d557f90 commit 8f0f12d
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/uniforms/__tests__/AutoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ describe('<AutoForm />', () => {

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
Expand All @@ -119,18 +119,14 @@ describe('<AutoForm />', () => {
}

render(
// @ts-expect-error Convoluted AutoForm types
<CustomAutoForm
autoField={Field}
model={model}
onChange={onChange}
schema={schema}
/>,
// @ts-expect-error JSX element type 'CustomAutoForm' does not have any construct or call signatures.ts(2604)
<CustomAutoForm model={model} onChange={onChange} schema={schema} />,
);

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 () => {
Expand Down

0 comments on commit 8f0f12d

Please sign in to comment.