I have a static method inside a React Component, like:
class DeliveryAddressScreen extends Component {
static isAddressReady(address) {
return !!(address)
}
sendAddress(address) {
if(this.isAddressReady(address)) {
// DO SOMETHING
}
}
}
And my test:
it('sample tests', () => {
const component = shallow(<DeliveryAddressScreen />)
component.instance().sendAddress('Address')
expect(true).toBe(true) // Just a sample
})
the feedback is:
TypeError: this.isAddressReady is not a function
Is there a right way to mock this method or something like that?