summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2017-06-26 22:43:32 -0500
committerMike Greiling <mike@pixelcog.com>2017-06-28 13:04:34 -0500
commitf26d4778656c32f550391d1986c4af1ed150364d (patch)
tree321444236cb65463832e682d0fcef6433ffde766 /spec/javascripts
parent3f3993c3d3da135ef32ba0abbff66d910a189bb6 (diff)
downloadgitlab-ce-f26d4778656c32f550391d1986c4af1ed150364d.tar.gz
dynamically import emoji helpers for AwardsHandler class
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/awards_handler_spec.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/spec/javascripts/awards_handler_spec.js b/spec/javascripts/awards_handler_spec.js
index 3fc03324d16..8e056882108 100644
--- a/spec/javascripts/awards_handler_spec.js
+++ b/spec/javascripts/awards_handler_spec.js
@@ -1,7 +1,7 @@
/* eslint-disable space-before-function-paren, no-var, one-var, one-var-declaration-per-line, no-unused-expressions, comma-dangle, new-parens, no-unused-vars, quotes, jasmine/no-spec-dupes, prefer-template, max-len */
import Cookies from 'js-cookie';
-import AwardsHandler from '~/awards_handler';
+import loadAwardsHandler from '~/awards_handler';
import '~/lib/utils/common_utils';
@@ -26,14 +26,13 @@ import '~/lib/utils/common_utils';
describe('AwardsHandler', function() {
preloadFixtures('issues/issue_with_comment.html.raw');
- beforeEach(function() {
+ beforeEach(function(done) {
loadFixtures('issues/issue_with_comment.html.raw');
- awardsHandler = new AwardsHandler;
- spyOn(awardsHandler, 'postEmoji').and.callFake((function(_this) {
- return function(button, url, emoji, cb) {
- return cb();
- };
- })(this));
+ loadAwardsHandler(true).then((obj) => {
+ awardsHandler = obj;
+ spyOn(awardsHandler, 'postEmoji').and.callFake((button, url, emoji, cb) => cb());
+ done();
+ }).catch(fail);
let isEmojiMenuBuilt = false;
openAndWaitForEmojiMenu = function() {