cibernox / ember-native-dom-helpers

Test helpers for your integration tests that fire native events

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

selectFiles Seems Broken in Chrome Canary

jherdman opened this issue · comments

Given:

  await selectFiles(
    '.some-selector',
    [
      new Blob(['test-test'], {
        name: 'foo.jpg',
        type: 'image/jpeg'
      }),
    ]
  );

I see the following error message in Chrome Canary (v62):

screen shot 2017-08-08 at 1 04 49 pm

@webark May I bring your attention to this?
@jherdman does this work for you on non-canary versions of chrome?

ya. I was trying to keep things as close to the traditional api as possible, but it looks like now chrome 62 doesn't work, and give a similar error as firefox did, but using a different message. Perhaps we need to abandon the hope that we could maintain the FileList object, and just reset it to an array.

In my experience error messages change very little. If we add another Regexp for chrome we might be good for the next 2 years.

No, this also appears to be broken in Chrome v60 too. The file list is empty (i.e. event.target.files).

ya. My only concern is that if both chrome and firefox do not support the mutating of the FileList is it worth even trying to do that?

@cibernox i think just replacing the FileList with an array is simpler and being that at least firefox and chrome no longer "support" the other way munching it, we should just keep with that. Take a look at #95 and let me know what you think.