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:
Diffstat (limited to 'spec/frontend/ide/init_gitlab_web_ide_spec.js')
-rw-r--r--spec/frontend/ide/init_gitlab_web_ide_spec.js43
1 files changed, 35 insertions, 8 deletions
diff --git a/spec/frontend/ide/init_gitlab_web_ide_spec.js b/spec/frontend/ide/init_gitlab_web_ide_spec.js
index efbbd6c7514..6a5bedb0bbb 100644
--- a/spec/frontend/ide/init_gitlab_web_ide_spec.js
+++ b/spec/frontend/ide/init_gitlab_web_ide_spec.js
@@ -4,6 +4,7 @@ import { initGitlabWebIDE } from '~/ide/init_gitlab_web_ide';
import { confirmAction } from '~/lib/utils/confirm_via_gl_modal/confirm_action';
import { createAndSubmitForm } from '~/lib/utils/create_and_submit_form';
import { handleTracking } from '~/ide/lib/gitlab_web_ide/handle_tracking_event';
+import Tracking from '~/tracking';
import { TEST_HOST } from 'helpers/test_constants';
import setWindowLocation from 'helpers/set_window_location_helper';
import waitForPromises from 'helpers/wait_for_promises';
@@ -15,6 +16,7 @@ jest.mock('~/lib/utils/csrf', () => ({
token: 'mock-csrf-token',
headerKey: 'mock-csrf-header',
}));
+jest.mock('~/tracking');
const ROOT_ELEMENT_ID = 'ide';
const TEST_NONCE = 'test123nonce';
@@ -34,9 +36,9 @@ const TEST_START_REMOTE_PARAMS = {
remotePath: '/test/projects/f oo',
connectionToken: '123abc',
};
-const TEST_EDITOR_FONT_SRC_URL = 'http://gitlab.test/assets/jetbrains-mono/JetBrainsMono.woff2';
+const TEST_EDITOR_FONT_SRC_URL = 'http://gitlab.test/assets/gitlab-mono/GitLabMono.woff2';
const TEST_EDITOR_FONT_FORMAT = 'woff2';
-const TEST_EDITOR_FONT_FAMILY = 'JebBrains Mono';
+const TEST_EDITOR_FONT_FAMILY = 'GitLab Mono';
describe('ide/init_gitlab_web_ide', () => {
let resolveConfirm;
@@ -54,9 +56,20 @@ describe('ide/init_gitlab_web_ide', () => {
el.dataset.userPreferencesPath = TEST_USER_PREFERENCES_PATH;
el.dataset.mergeRequest = TEST_MR_ID;
el.dataset.filePath = TEST_FILE_PATH;
- el.dataset.editorFontSrcUrl = TEST_EDITOR_FONT_SRC_URL;
- el.dataset.editorFontFormat = TEST_EDITOR_FONT_FORMAT;
- el.dataset.editorFontFamily = TEST_EDITOR_FONT_FAMILY;
+ el.dataset.editorFont = JSON.stringify({
+ fallback_font_family: 'monospace',
+ font_faces: [
+ {
+ family: TEST_EDITOR_FONT_FAMILY,
+ src: [
+ {
+ url: TEST_EDITOR_FONT_SRC_URL,
+ format: TEST_EDITOR_FONT_FORMAT,
+ },
+ ],
+ },
+ ],
+ });
el.dataset.signInPath = TEST_SIGN_IN_PATH;
document.body.append(el);
@@ -88,7 +101,11 @@ describe('ide/init_gitlab_web_ide', () => {
});
describe('default', () => {
+ const telemetryEnabled = true;
+
beforeEach(() => {
+ Tracking.enabled.mockReturnValueOnce(telemetryEnabled);
+
createSubject();
});
@@ -115,12 +132,22 @@ describe('ide/init_gitlab_web_ide', () => {
signIn: TEST_SIGN_IN_PATH,
},
editorFont: {
- srcUrl: TEST_EDITOR_FONT_SRC_URL,
- fontFamily: TEST_EDITOR_FONT_FAMILY,
- format: TEST_EDITOR_FONT_FORMAT,
+ fallbackFontFamily: 'monospace',
+ fontFaces: [
+ {
+ family: TEST_EDITOR_FONT_FAMILY,
+ src: [
+ {
+ url: TEST_EDITOR_FONT_SRC_URL,
+ format: TEST_EDITOR_FONT_FORMAT,
+ },
+ ],
+ },
+ ],
},
handleStartRemote: expect.any(Function),
handleTracking,
+ telemetryEnabled,
});
});