A platform for community discussion. Free, open, simple.
PERFORMANCE: disables jquery animations during testing
Joffrey JAFFEUX59d4123316de
diff --git a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 b/app/assets/javascripts/discourse/widgets/post-menu.js.es6index da86b5d6317..7b177a39e6d 100644--- a/app/assets/javascripts/discourse/widgets/post-menu.js.es6+++ b/app/assets/javascripts/discourse/widgets/post-menu.js.es6@@ -416,18 +416,14 @@ export default createWidget('post-menu', {const $heart = $(`[data-post-id=${attrs.id}] .toggle-like .d-icon`);$heart.closest('button').addClass('has-like');- if (!Ember.testing) {- const scale = [1.0, 1.5];- return new Ember.RSVP.Promise(resolve => {- animateHeart($heart, scale[0], scale[1], () => {- animateHeart($heart, scale[1], scale[0], () => {- this.sendWidgetAction('toggleLike').then(() => resolve());- });+ const scale = [1.0, 1.5];+ return new Ember.RSVP.Promise(resolve => {+ animateHeart($heart, scale[0], scale[1], () => {+ animateHeart($heart, scale[1], scale[0], () => {+ this.sendWidgetAction('toggleLike').then(() => resolve());});});- } else {- this.sendWidgetAction('toggleLike');- }+ });},refreshLikes() {diff --git a/test/javascripts/test_helper.js b/test/javascripts/test_helper.jsindex 83716217317..e5832987b45 100644--- a/test/javascripts/test_helper.js+++ b/test/javascripts/test_helper.js@@ -169,4 +169,7 @@ Object.keys(requirejs.entries).forEach(function(entry) {}});+// forces 0 as duration for all jquery animations+jQuery.fx.off = true;+resetSite();