Testing elements when the scope changes