I've wrote a javascript method that changes the value of a suggestbox on a click of an image.
function startDestinationF(a) {
var startDestination = document.getElementById('startDestination');
startDestination.selectedIndex = (a);}
Now i have to write a jasmine testcase to check if this method really works but i don't really get it.
i've tried:
describe("Change onclick the value of the drop down menu", function() {
var startDestination;
beforeEach(function() {
startDestination = document.getElementById('startDestination');
});
it("should change the value", function() {
expect(startDestinationF(3)).toBe(startDestination.selectedIndex==3);
});});
but it says: "Cannot read property 'selectedIndex' of null". I'm a newbie on that field and i could really need some help...
thanks