title: How to add a div to the DOM in AngularJS unit tests?
body: <p>I'm using the following code in a directive to place a tool tip</p>
  
  <pre><code>var bodyoffset = document.querySelector(".smallcontainer-content").getBoundingClientRect();
  var width = elm.width();
  if(bodyoffset != undefined){
      var tooltipDiv = document.querySelector(".tooltip");
      angular.element(tooltipDiv).css("top", offset.top-bodyoffset.top+"px");
      angular.element(tooltipDiv).css("left", offset.left-bodyoffset.left+width+5+"px");
  }
  </code></pre>
  
  <p>This doesn't work in a unit test as the div the class 'smallcontainer' is on doesn't exist. How can I make sure the div is created in the unit test so that I can test all my functions?</p>