lundi 21 août 2017

Can't undestand why ember tests working so strange

I can't understand why my emberjs test code runs so strange. I wrote a test which should only select some html elements and give me number of them. This code works:

test('visiting /feedback/my', function(assert) {
  visit('/feedback/my');

  // if i remove this andThen test becomes failed
  andThen(function(){
    find(".feedback-item");     
  });
  
  andThen(function(){
    assert.equal(find(".feedback-item").length > 0, true, "There are more than 0 feedback");
  });

  click(".feedback-item:first a");

  andThen(function() {
    assert.equal(currentURL(), '/feedback/1', "New URL is /feedback/1");
  });
});

But the same code but without (if i delete / comment it) this part andThen(function(){ find(".feedback-item")}); doesn't work. It throw's an exception: Element .feedback-item:first a not found.




Aucun commentaire:

Enregistrer un commentaire