ember-native-dom-helpers
ember-native-dom-helpers copied to clipboard
'selectFiles' Not working when calling twice
When i try to use the selectFiles helper twice in the same input this erro ocour:
TypeError: Cannot redefine property: files at Function.defineProperty (<anonymous>) at buildFileEvent (fire-event.js:190) at fireEvent (fire-event.js:50) ...
I was able to fix the problem just addin the files attribute before calling the selectFiles helper, but adding the configurable option to allow the attribute to be changed.
Object.defineProperty(find(${selector} [data-test-input-file]), 'files', { value: {}, configurable: true });
I was also experiencing this with @ember/test-helpers
https://github.com/emberjs/ember-test-helpers/pull/326