title: Parent not defined when testing a directive element
body: <p>I have an angularjs directive that just assigns the height of the element to equal height of its second parent (something like <code>element.height = element.parent().parent().height</code>) in the link function.</p>
  
  <p>However, when I create and try to compile the directive element in my unit test against an isolated scope, I get <code>element.parent().parent().height</code> is not a function. I suppose the parent is somehow undefined when compiling.   </p>
  
  <p>How can it be resolved using the same or different approach? Thanks.</p>