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

makeList fails trying to read a number as a trait #177

Closed
visoft opened this issue Mar 2, 2016 · 4 comments
Closed

makeList fails trying to read a number as a trait #177

visoft opened this issue Mar 2, 2016 · 4 comments

Comments

@visoft
Copy link
Contributor

visoft commented Mar 2, 2016

I'm trying to test a component. I am using manualSetup inside my beforeEach

import { makeList , manualSetup }  from 'ember-data-factory-guy';
...
test('it renders the data for widgets', function(assert) {
  let widgets = makeList('widget', 2);
  assert.equal(widgets.length, 2);
  ...
})

When running the test, I get Cannot read property '2' of undefined.

I'm using the latest version 2.3.0 with Ember 2.4.1, Ember Data 2.4.0, and Ember CLI 2.4.1. It fails on line 75 of model-definition.js. _jquery['default'].extend(traitsObj, traits[trait]);, where traits is undefined and trait is the number 2.

It works correctly if I use makeList like so: makeList('widget', {name: 'Foo'}, {name: 'Bar'});

Is it something with the component test and manualSetup? It was working with the previous version of ember-data-factory-guy.

@danielspaniel
Copy link
Collaborator

Yes, I see that bug, will fix by tonight and release new patch.

@visoft
Copy link
Contributor Author

visoft commented Mar 2, 2016

Thanks 👍

@danielspaniel
Copy link
Collaborator

Actually was easy, just fixed it. New version 2.3.1 is out, and has the fix. :)

@visoft
Copy link
Contributor Author

visoft commented Mar 2, 2016

You're awesome! Works great now.

@visoft visoft closed this as completed Mar 2, 2016
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

2 participants