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

Introduce registerSelectHelper #14

Merged
merged 1 commit into from
May 14, 2015

Conversation

seanpdoyle
Copy link
Contributor

#13

Adds the select helper to deal with integration level tests.

Closes #13.

@seanpdoyle
Copy link
Contributor Author

I haven't seen a proper example of how to bundle an async test helper, so if you don't think this is a good approach, let me know.

@cowboyd
Copy link
Collaborator

cowboyd commented Apr 14, 2015

Thanks for the PR!

It looks like there's a build error. Can you update the acceptance tests to use this helper?

Also, let's add the index version so that I can say:

select('.my-select-box', 'option text')

as well as

select('.my-select-box', 2)

adopted-ember-addons#13

Adds the `select` helper to deal with integration level tests.

Closes adopted-ember-addons#13.
@seanpdoyle
Copy link
Contributor Author

@cowboyd I've fixed the imports / syntax errors in the helper itself.

Could you point me to where in the acceptance tests I could use the helper? It seems like everything is done synchronously and at the controller level, not the application level

@cowboyd
Copy link
Collaborator

cowboyd commented Apr 22, 2015

@seanpdoyle it looks like the tests are hanging for some reason. Have you had a chance to look at this?

@seanpdoyle
Copy link
Contributor Author

@cowboyd not yet. Hopefully I'll get around to it on Friday

this.selected = true;
Ember.$(this).trigger('change');
});
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seanpdoyle I decided to checkout this branch and see why Travis is hanging. It seems you can't use the fat arrow OR the string interpolation here.

Refactored (and not as nice ES6 😦 ) code:

var $el = app.testHelpers.findWithAssert(selector + "option:contains('" + text + "')");

$el.each(function() {
  var _this = this;

  Ember.run(function() {
    _this.selected = true;
    Ember.$(_this).trigger('change');
  });
});

@Robdel12 Robdel12 merged commit 5b6adf2 into adopted-ember-addons:master May 14, 2015
@seanpdoyle seanpdoyle deleted the async-test-helper branch May 15, 2015 00:11
@seanpdoyle
Copy link
Contributor Author

@Robdel12 👏 for doing the leg work

@Robdel12
Copy link
Collaborator

@seanpdoyle no problem! :p

@Robdel12 Robdel12 mentioned this pull request Jun 11, 2015
4 tasks
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 this pull request may close these issues.

How does this work with fillIn test helper?
3 participants