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

TypeError: owner.lookup is not a function in Acceptance tests #64

Open
bmrsny opened this issue Apr 5, 2016 · 10 comments
Open

TypeError: owner.lookup is not a function in Acceptance tests #64

bmrsny opened this issue Apr 5, 2016 · 10 comments

Comments

@bmrsny
Copy link

bmrsny commented Apr 5, 2016

Trying to use the Plupload Test Helpers, and can't get past the addFiles function...
Am I not adding the correct instance to addFiles() ?
I have tried this.container as well.

acceptance test

import { test } from 'qunit';
import moduleForAcceptance from 'uma/tests/helpers/module-for-acceptance';
import { addFiles } from 'ember-plupload/test-helper';
moduleForAcceptance('Acceptance | uploads');

test('uploading a csv', function (assert) {
let [file] = addFiles(this.application, 'csv-uploader', {
    name: 'ember.csv',
  });
});

backtrace

TypeError: owner.lookup is not a function
    at addFiles (http://localhost:7357/assets/vendor.js:136549:26)
    at Object.<anonymous> (http://localhost:7357/assets/tests.js:170:59)
    at runTest (http://localhost:7357/assets/test-support.js:2750:28)
    at Object.Test.run (http://localhost:7357/assets/test-support.js:2735:4)
    at http://localhost:7357/assets/test-support.js:2877:11
    at process (http://localhost:7357/assets/test-support.js:2537:24)
    at begin (http://localhost:7357/assets/test-support.js:2519:2)
    at http://localhost:7357/assets/test-support.js:2579:4```
@Lydias303
Copy link

Still having this issue. Would love some help debugging!

@tim-evans
Copy link
Collaborator

What's the version of Ember you're using?

@Lydias303
Copy link

"ember-cli": "2.8.0",   "ember-plupload": "1.13.17",

@tim-evans
Copy link
Collaborator

Thanks! Lemme check this out

@pleszkowicz
Copy link

pleszkowicz commented Dec 1, 2016

Hey guys! I have the same problem.
I'm using:

"ember": "2.9.1"
"ember-cli": "2.9.1
"ember-plupload": "1.13.17"

The problem is here:
https://github.com/tim-evans/ember-plupload/blob/master/addon/test-helper.js#L93

Passed owner object has no lookup() method.
Then I passed this.application.__container__ (I know, I know :) and it fixed above problem. The container has lookup() method, but...
During further debugging, script is failing at
https://github.com/moxiecode/plupload/blob/v2.1.8/js/plupload.dev.js#L1751

  • settings.browse_button is an array which contains 1 undefined element
  • settings.url - undefined

@john-griffin
Copy link

Also just hit this.

@tim-evans
Copy link
Collaborator

This is totally deprecated. I will see if I can use owner 👍 Help to fix this would be amaaazing

@ashrafhasson
Copy link

ashrafhasson commented Apr 13, 2017

I'm facing a similar issue with ember-cli 2.5.1. Using this.application.__container__ in the acceptance test seems to get me past the issue of looking up owner but the test fails to trigger my component's target.

Test generates this message:

undefined is not an object (evaluating 'get(this, 'target').sendAction')

Not sure if this is caused by the issue above. Would be great if someone can provide a hint, please.

@tim-evans
Copy link
Collaborator

Ahh, yes. Sorry about not taking care of this in a timely manner

@tim-evans
Copy link
Collaborator

I've been using ember-file-upload in projects and have been neglecting this. So, it's probably good to note that if someone would like to maintain this, that would be 👍 👍 👍

I will add patches here and there for support

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

No branches or pull requests

6 participants