title: How I can test uploading files into `input[type="file"]` Vue.js?
body: <p>I've wrote a custom <code>input[type="file"]</code> component.
  And I'd like to write a unit test for the next situation:</p>
  
  <ol>
  <li>Upload file to input</li>
  <li>Read the file's name and write him to the tag span or another. </li>
  </ol>
  
  <p>I wrote below test. But I think this is a wrong way to mock file in input.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>it("check download file to input", () =&gt; {
    const files = [
      {
        name: "test.png",
        size: 50000,
        type: "image/png"
      }
    ];
    const wrapper = mount(InputCropper);
    const input = wrapper.find('input[type="file"]');
    input.files = files;
    input.trigger("change");
  
    expect(input.files.length).to.equal(1);
  });</code></pre>
  </div>
  </div>
  </p>