test with spyOn