Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-08 09:09:13 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-08 09:09:13 +0300
commit0a319374e7784aa5c2d1c30dd832d2a0509edbab (patch)
tree123c5bac601b85d60cbaba541b25aed8c981c529 /spec/frontend/awards_handler_spec.js
parent5683a027b79d2236bf9b3d1eb5303075584894d7 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/awards_handler_spec.js')
-rw-r--r--spec/frontend/awards_handler_spec.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/frontend/awards_handler_spec.js b/spec/frontend/awards_handler_spec.js
index 754f0702b84..ef09c59b5f6 100644
--- a/spec/frontend/awards_handler_spec.js
+++ b/spec/frontend/awards_handler_spec.js
@@ -1,13 +1,17 @@
import $ from 'jquery';
import Cookies from 'js-cookie';
+import MockAdapter from 'axios-mock-adapter';
+import axios from '~/lib/utils/axios_utils';
import loadAwardsHandler from '~/awards_handler';
import '~/lib/utils/common_utils';
import waitForPromises from './helpers/wait_for_promises';
+import { EMOJI_VERSION } from '~/emoji';
window.gl = window.gl || {};
window.gon = window.gon || {};
let openAndWaitForEmojiMenu;
+let mock;
let awardsHandler = null;
const urlRoot = gon.relative_url_root;
@@ -24,8 +28,13 @@ const lazyAssert = (done, assertFn) => {
};
describe('AwardsHandler', () => {
+ const emojiData = getJSONFixture('emojis/emojis.json');
preloadFixtures('snippets/show.html');
+
beforeEach(done => {
+ mock = new MockAdapter(axios);
+ mock.onGet(`/-/emojis/${EMOJI_VERSION}/emojis.json`).reply(200, emojiData);
+
loadFixtures('snippets/show.html');
loadAwardsHandler(true)
.then(obj => {
@@ -58,6 +67,8 @@ describe('AwardsHandler', () => {
// restore original url root value
gon.relative_url_root = urlRoot;
+ mock.restore();
+
// Undo what we did to the shared <body>
$('body').removeAttr('data-page');