In my javascript file below mentioned code is present. But when I run Javascript test cases via Qunit.js and Blanket.js I am getting this error in chrome: "Cannot read property 'substring' of undefined - {}"
if ($("label[for=ReservationInformation]").text().substring(0, 1) != "*") {
$("label[for=ReservationInformation]").text("*" + $("label[for=ReservationInformation]").text());
}
I have defined test case as:
test("validationChecker test", 1, function () {
var div = $('<div>').appendTo("body");
$('<input>', { id: "ReservationInformation" }).appendTo(div);
$('<label>', { "for": "ReservationInformation" }).appendTo(div);
var result = validationChecker(null);
equal(undefined, result, "passed");
$("div").remove();
});