Skip to content

Commit

Permalink
Test fixes for EMber 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncan Graham Walker committed Dec 10, 2015
1 parent c1734a1 commit 8501999
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"devDependencies": {
"compass-mixins": "~1.0.2",
"ember-qunit": "0.4.13",
"ember-qunit": "^0.4.17",
"ember-qunit-notifications": "0.1.0",
"hammerjs": "~2.0.4",
"matchMedia": "0.2.0",
Expand Down
13 changes: 9 additions & 4 deletions tests/helpers/async/mouse-out.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,23 @@ export default Ember.Test.registerAsyncHelper('mouseOut',
function(app, name) {
const selector = selectorFor(name);
const $element = inspect(name);
const $tooltips = Ember.$('.tooltip');

let elementExists = $element.length;

triggerEvent(selector, 'mouseout');

/* Wait until the element is removed to continue the tests */

Ember.$('.tooltip')[0].addEventListener('DOMNodeRemovedFromDocument', function() {
Ember.run(function() {
elementExists = false;
if ($tooltips.length) {
$tooltips[0].addEventListener('DOMNodeRemovedFromDocument', function() {
Ember.run(function() {
elementExists = false;
});
});
});
} else {
elementExists = false;
}

Ember.Test.registerWaiter(function() {
return !elementExists;
Expand Down

0 comments on commit 8501999

Please sign in to comment.