Commit f252fbf4 authored by Denys Mishunov's avatar Denys Mishunov Committed by Brandon Labuschagne

Editor Lite: Set the default for blobGlobalId

parent a43eaf5c
......@@ -6,6 +6,7 @@ import { registerLanguages } from '~/ide/utils';
import { joinPaths } from '~/lib/utils/url_utility';
import { clearDomElement } from './utils';
import { EDITOR_LITE_INSTANCE_ERROR_NO_EL, URI_PREFIX } from './constants';
import { uuids } from '~/diffs/utils/uuids';
export default class Editor {
constructor(options = {}) {
......@@ -72,7 +73,7 @@ export default class Editor {
el = undefined,
blobPath = '',
blobContent = '',
blobGlobalId = '',
blobGlobalId = uuids()[0],
extensions = [],
...instanceOptions
} = {}) {
......
......@@ -64,7 +64,7 @@ describe('Base editor', () => {
});
it('creates model to be supplied to Monaco editor', () => {
editor.createInstance({ el: editorEl, blobPath, blobContent });
editor.createInstance({ el: editorEl, blobPath, blobContent, blobGlobalId: '' });
expect(modelSpy).toHaveBeenCalledWith(blobContent, undefined, createUri(blobPath));
expect(setModel).toHaveBeenCalledWith(fakeModel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment