Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Doesn't play nice with wait() in Integration tests #48

Closed
hhff opened this issue Jan 25, 2016 · 9 comments
Closed

Doesn't play nice with wait() in Integration tests #48

hhff opened this issue Jan 25, 2016 · 9 comments

Comments

@hhff
Copy link

hhff commented Jan 25, 2016

Just updated to v2.0.0-beta.1 in an addon project to test whether #28 was fixed - unfortunately the problem persists.

As mentioned there, Testing code (component integration test) like this...

// Trigger something that uses `ember-ajax` under the hood
this.$('button').click();

return wait().then(() => {
  // assertions
  asset.ok(...something);
});

...won't actually wait for the Ember Ajax request to return.

Will do a bit of investigating now - but just wanted to reopen this. Thank you~ ❤️

@hhff
Copy link
Author

hhff commented Jan 25, 2016

Scratch that, works great! My bad

@hhff hhff closed this as completed Jan 25, 2016
@rwjblue
Copy link
Member

rwjblue commented Jan 25, 2016

Whew! OK, great to hear. I was worried for a minute...

@hhff
Copy link
Author

hhff commented Jan 25, 2016

Haha yeah was just about to put on the deepdive helmet

@hhff hhff reopened this Jan 25, 2016
@hhff
Copy link
Author

hhff commented Jan 25, 2016

Ahhh dang - I'm sorry to blow this repo up - I doubled tripped - I am actually still experiencing this problem.

I just pushed up a repo (it's a simple email form for Mailchimp) to reproduce this issue.

Here is the line in the testing code that isn't waiting for for
Ajax Request.

Here's the line where the Ajax Request is actually sent.

Hopefully will get a chance to look into this today

@taras
Copy link
Contributor

taras commented Jan 25, 2016

@hhff It should work. Can we pair on this to try to figure this out? I'd like to find out why it's not working.

@hhff
Copy link
Author

hhff commented Jan 25, 2016

@taras yeah totally! will ping u on ember slack

@taras
Copy link
Contributor

taras commented Jan 30, 2016

Alex and I paired on this issue and it turns out that you're using JSONP which doesn't trigger ajaxSend and ajaxComplete events. We're going to manually trigger these events when JSONP is used. We have a working solution. Alex is going to prepare a PR.

@alexlafroscia
Copy link
Collaborator

Hey @hhff I updated ember-chimp to the latest version of the Ember CLI as part of the debugging earlier today. Would you want that PR'd to you? Or should I just trash it?

@hhff
Copy link
Author

hhff commented Feb 1, 2016

@taras ahhhhhhh bingo

@alexlafroscia a PR would be amazing!!

awesome work guys 👍

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

4 participants