Under 'Tips' in the react documentation they describe a pattern for communicating between components where a parent component calls a method on the child (via a ref).
I am using a third party react component that requires me to use this approach.
I would like to unit test my component and check that it calls the child's method (with the right parameters) under the right circumstances, but I'm having trouble figuring out how...
For the example in the Facebook documentation, how would I write a test that checks Todos calls animate on the last Todo when it should?
Aucun commentaire:
Enregistrer un commentaire