I'm using jasmine for my unit tests. I have a function that contains:
var startDate = $("#startDate").data("kendoDatePicker").value();
But when the unit test hits that line it errors out saying:
TypeError: Cannot read property 'value' of null
I've tried stuff like setting it
$("#startDate").data("kendoDatePicker").value = '12/25/2014';
but that results in "cannot set value of null"(or something along those lines)
and I've tried to spy on it, but in all honesty, my knowledge here is limited. I'm hoping I'm just missing some basic terminology in my google searches and someone will be able to help me.
How do I mock this or spy on it?
Thanks in advance!
Aucun commentaire:
Enregistrer un commentaire