title: How to mock dom element from karma testing
body: <p>There is an input type file element. During angular file upload multiple times, the value is not being cleared. Hence manually clearing it using plain javascript dom manipulation. </p>
  
  <p>Below is the code:</p>
  
  <pre><code>function removeFromQueue(item) {
          vm.uploads.uploader.removeFromQueue(item);
          // Clearing input file field for re-uploading
          if(!vm.uploadFile) {
              document.getElementById('upload-file-' + vm.type).value = null;
          }
      }
  </code></pre>
  
  <p>In this case, not able to mock the <code>document.getElementById</code>, hence controlling it using <code>vm.uploadFile</code> undefined variable from unit test case which is wrong. How to mock the dom element here?</p>