Skip to content
This repository has been archived by the owner on May 26, 2019. It is now read-only.

Add examples of ember-test-helpers wait helper. #909

Closed
rwjblue opened this issue Oct 21, 2015 · 6 comments
Closed

Add examples of ember-test-helpers wait helper. #909

rwjblue opened this issue Oct 21, 2015 · 6 comments

Comments

@rwjblue
Copy link
Member

rwjblue commented Oct 21, 2015

This was added in emberjs/ember-test-helpers#112 (and is available in ember-qunit 0.4.13 and higher). The largest benefit here is the ability to wait for pending async in your component integration tests.

Example from the above PR (assumes the component does some async in an action triggered by the button click):

import { moduleForComponent, test } from 'ember-test-helpers';
import wait from 'ember-test-helpers/wait';

test('it works when async exists in an event/action', function(assert) {
  this.render('{{my-foo}}');

  this.$('button').click();

  return wait()
    .then(() => {
      // assertions for after async behavior
    });
});
@toddjordan
Copy link
Contributor

cool, I'd be happy to get something in there 👍

@michaelrkn
Copy link
Contributor

@toddjordan, Ember Guides testing mastermind :)

@toddjordan
Copy link
Contributor

@michaelrkn is it an evil mastermind? 😼

@michaelrkn
Copy link
Contributor

😱

@locks
Copy link
Contributor

locks commented Oct 22, 2015

let's test it and find out!

@acorncom
Copy link
Contributor

This issue should be closed

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

No branches or pull requests

5 participants