Jasmine test For input type file and disabling/enabling a button on change event
<p>I would like to know how Jasmine can test for the enabling/disabling of an input based on the change event. I have the following code in a function that I would like to be tested: -</p>

<pre><code>$('#file-selector').change(function () {
    var file = $('#file-selector').val();
   if (file == '') {
        $('#import').attr("disabled", true);
   } else {
        $('#import').attr("disabled", false);
   }
}); 
</code></pre>

<p>Here's where I've got to so far, but would like to know the best way to achieve this.</p>

<pre><code>beforeEach(function () {
    setFixtures('&lt;div id="file-selector-wrapper"&gt;' + '&lt;input id="file-selector" name="xmlFile" type="file" /&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;' +
        '&lt;button id="import" type="submit" class="btn" disabled="disabled"&gt;&lt;/button&gt;');
});

it('disables import button when file does not exist', function () {
    var openSpy = jasmine.createSpy('open');
    $("#file-selector").trigger('change');

});
</code></pre>