ordinary-sapphireO
Refine3y ago
1 reply
ordinary-sapphire

How to mock useForm queryResult only?

HI. Currently i have this code. Im mocking queryResult.

jest.mock('@pankod/refine-antd', () => ({
  ...(jest.requireActual('@pankod/refine-antd')),
  useForm: () => {
    return {
      queryResult: {
        data: {
          data: {
            name: ''
          }
        },
        isLoading: true
      }
    }
  }
}))

The problem is that, i need to retain the formprops and saveButtonProps
i only need to mock the queryResult.

How can i do it ?
Was this page helpful?