CON-1784 | added tests; adjusted visibility ckecking function; addded cheking if prev element to hook element is visible for Sloth module