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' Not working when calling twice

raphaelns-developer opened this issue · comments

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
emberjs/ember-test-helpers#326