html-next/smoke-and-mirrors

VerticalCollection causing Ember Acceptance tests to fail (run-loop's autorun disabled warning)

oliverwilkie opened this issue · 9 comments

Hi!

I'm having difficulty getting my Ember Acceptance tests to pass once I start using the VerticalCollection in 0.3.6.

Here is a simplified version of my test

visit '/page' // Page loads and renders vertical collection for the first time
andThen ->
  click('.changeArrayContents')  // Changes the contents of the array bound to the vertical collection
andThen ->

On the final andThen I get the following

Assertion Failed: You have turned on testing mode, which disabled the run-loop's autorun.
                  You will need to wrap any code with asynchronous side-effects in a run

Adding a breakpoint shows that occulusion-collection#_updateChildStates gets called which in turn calls

this.sendActionOnce('firstReached', {
            item: component,
            index: bottomComponentIndex
          })

which triggers the error above.

Am I using the collection incorrectly?

Maybe I need to make use of this option?

  /**!
   * Set this to false to prevent rendering entirely.
   * Useful for situations in which rendering is
   * expensive enough that it interferes with a
   * transition animation.
   *
   * In such cases, set this to false, and switch it
   * to true once animation has completed.
   */
    shouldRender: true,

Thanks!

It's highly possible that this is the collection's fault and not yours. I use the run loop within a special container in order to make teardown less buggy. This was necessary when dozens of calls were being scheduled into the loop, but now there are only a small handful. This run loop container is on the chopping block for 0.3.7

This is likely fixed by #51, would be great if you could check out the latest master and report back

Sorry, meant the PR #60 that's now on master.

Hi @runspired
I am also facing same issue while running acceptance test cases. On debug, I found that its failing at
https://github.com/runspired/smoke-and-mirrors/blob/develop/addon/models/radar.js#L278

I am using the latest version 0.5.1

offers page has list of all offers and am using vertical-collection component:

        {{#vertical-collection
          content=arrangedContent
          alwaysUseDefaultHeight=true
          containerSelector="body"
          as |offer|
          }}
              {{partial 'offers/offer_details'}}
          {{/vertical-collection}}

Here is the test case:

test("redirect to offers page", function() {
  visit("/offers");
  andThen(function(){
    equal(currentURL(), "/offers/submitted");
    equal(find("ul.list li").length, 1);
    equal(find("ul.list img").length, 1);
});

Do I need to wrap the whole test inside Ember.run(() => {...}) ?
Am I missing anything?

Upgrading node-version and ember version fixed issue with test cases. Thanks!
cc: @runspired

@swatijadhav what ember version did you upgrade to? i am seeing this error on v2.4.1

@joeyjiron06 Previously I was facing this issue on ember v1.13.8 and after upgrading it to v1.13.13 worked for us.
But today after upgrading it to ember v2.1.0, am getting this issue again. and strange thing that you are facing it on v2.4.1 :(
Please let me know if you able to get the solution for it. Thanks.

I also see this issue on ember v1.13.13 - @swatijadhav @joeyjiron06 did you find a solution for this?

I have suspicions as to what is causing it and what will fix it, but won't have time to really dig in until next week. I'm trying to get all my addons back in shape one at a time, and this week is Flexi and ember-hammertime's turn :D