Added check if stored value is a number to spyOn, since localStorage will store integers as strings.