how to mock a function in react testing library

I am new to react-testing-library and I have been trying to test one function for a long time.
for example, I want to check if when a button is clicked a given function is called and it’s throwing errors. so any help would be highly appreciated and if possible share with me any helpful resources.

signin.js

export default class SignIn extends Component {
    constructor(props) {
        super(props);
        this.state = {
        };
    }

    handleClose = (event, reason) => { };
    validate = () => { };
    change = (e) => { };
    onSubmit = (e) => { };

    render() {
        return (<div>...</div>);
    }
}

Full: https://github.com/blaise82/react-testing-library-try/blob/master/src/views/SignIn.js

this is my test

it('should submit form', async () => {
    const { getByLabelText, getByText, container, debug } = render(<SignIn />);
    const change = jest.fn();
    const onSubmit = jest.fn();
    const email = getByLabelText('email');
    const password = getByLabelText('password');
    const submit = getByLabelText('submit');

    userEvent.type(email, '[email protected]');
    expect(email.value).toBe('[email protected]');
    expect(password.value).toBe('');
    expect(change).toHaveBeenCalled();

    console.log(password)
    await userEvent.click(submit);
    expect(onSubmit).toHaveBeenCalled();

});

Full: https://github.com/blaise82/react-testing-library-try/blob/master/src/test/signin.test.js

results

>    Expected number of calls: >= 1
>     Received number of calls:    0

please let know what I am doing wrong.

Full code on GitHub: https://github.com/blaise82/react-testing-library-try

Source: ReactJs