How does jest get methods within components wrapped by Form.create ()

simple components:

export default class Test extends React.Component {
    constructor() {
        super();
        this.onChange = this.onChange.bind(this);
        this.state = {};
    }
    onChange(key, value) {}
    render() {
        return (
            <div className="daka-login">
            </div>
        );
    }
}

components wrapped by Form form components:

class Test extends React.Component {
    constructor() {
        super();
        this.onChange = this.onChange.bind(this);
        this.state = {};
    }
    onChange(key, value) {}
    render() {
        return (
            <div className="daka-login">
            </div>
        );
    }
}

const WrappedUserTest = Form.create()(Test);
export default WrappedUserTest;

onChange methods for simple components can be tested in the following ways:

mount(<Test {...props} />).instance().onChange()

but the package wrapped by the Form form will report an error. How should I modify it? thank you.

Mar.06,2021

Let me solve your problem perfectly

clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c2f0d5-16178.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c2f0d5-16178.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?