jeudi 9 juillet 2015

You cannot use the same root element (#ember-testing) multiple times in an Ember.Application

Its happens when i run ember test and try to visit('/') twice

import Ember from 'ember';
import {module, test} from 'qunit';
import startApp from '../helpers/start-app';
import Router from '../../router';

var App;

module('Integration - Secret', {
  setup: function(){
    App = startApp();
    visit('/');
  },

  teatdown: function(){
    Ember.run(App, 'destroy');
  }
});

test('by default the image is not shown', function(assert){
  assert.expect(1);
  andThen(function() {
    assert.equal(find('.secret').length, 0);
  });
});

test('the image shows up when pass is correct', function(assert){
assert.expect(2);
  fillIn('input.secret-value', 'hello');
  click('button.check-password');
  andThen(function(){
    assert.equal(find('.secret').length, 1);
  });

  fillIn('input.secret-value', 'not hello');
  click('button.check-password');
  andThen(function(){
    assert.equal(find('.secret').length, 0);
  });

});

Terminal out:

not ok 6 PhantomJS 1.9 - Integration - Secret: the image shows up when pass is correct
    ---
        actual: >
            false
        expected: >
            true
        message: >
            Error: Assertion Failed: You cannot use the same root element (#ember-testing) multiple times in an Ember.Application
        Log: >

Aucun commentaire:

Enregistrer un commentaire