Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload helper doesn't work with ember-test-helpers@1.0.0 #189

Closed
andreyfel opened this issue Oct 31, 2018 · 2 comments · Fixed by #237
Closed

Upload helper doesn't work with ember-test-helpers@1.0.0 #189

andreyfel opened this issue Oct 31, 2018 · 2 comments · Fixed by #237

Comments

@andreyfel
Copy link
Contributor

When we use 'upload' test helper with ember-test-helpers@1.0.0 there is an exception.

TypeError: Cannot read property 'length' of undefined
at buildFileEvent (http://localhost:4202/assets/tests.js:810:15)
at fireEvent (http://localhost:4202/assets/tests.js:695:15)
at http://localhost:4202/assets/tests.js:1050:30
at tryCatcher (http://localhost:4202/assets/vendor.js:71571:21)
at invokeCallback (http://localhost:4202/assets/vendor.js:71743:33)
at publish (http://localhost:4202/assets/vendor.js:71729:9)
at http://localhost:4202/assets/vendor.js:63970:16
at invokeWithOnError (http://localhost:4202/assets/vendor.js:39668:28)
at Queue.flush (http://localhost:4202/assets/vendor.js:39571:25)
at DeferredActionQueues.flush (http://localhost:4202/assets/vendor.js:39738:31)

It is probably related to this change: emberjs/ember-test-helpers#428

@Subtletree
Copy link
Contributor

Yip, looks like we need:
return await triggerEvent(input, 'change', { files });

instead of:

return await triggerEvent(input, 'change');

or

return await triggerEvent(input, 'change', files);

would be backwards compatible but have a deprecation warning
https://github.com/emberjs/ember-test-helpers/blob/7993c67a1987e158574c629b1f2b4e12ddeaf5be/addon-test-support/%40ember/test-helpers/dom/fire-event.ts#L256

@raphaelns-developer
Copy link

When the fix will be applied?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants