Commit 7e78bc41 authored by Denys Mishunov's avatar Denys Mishunov

Renamed decorateInstance to convertMonacoToELInstance

As per review
parent 38f794b9
......@@ -134,7 +134,7 @@ export default class EditorLite {
return diffModel;
}
static decorateInstance = (inst) => {
static convertMonacoToELInstance = (inst) => {
const decoratedInstance = inst;
decoratedInstance.updateModelLanguage = (path) => {
const lang = EditorLite.getModelLanguage(path);
......@@ -194,7 +194,7 @@ export default class EditorLite {
let model;
const createEditorFn = diff ? 'createDiffEditor' : 'create';
const instance = EditorLite.decorateInstance(
const instance = EditorLite.convertMonacoToELInstance(
monacoEditor[createEditorFn].call(this, el, {
...this.options,
...instanceOptions,
......
......@@ -58,7 +58,7 @@ describe('Base editor', () => {
modelSpy = jest.spyOn(monacoEditor, 'createModel').mockImplementation(() => res);
};
const mockDecorateInstance = (decorations) => {
jest.spyOn(EditorLite, 'decorateInstance').mockImplementation((inst) => {
jest.spyOn(EditorLite, 'convertMonacoToELInstance').mockImplementation((inst) => {
return Object.assign(inst, decorations);
});
};
......@@ -82,7 +82,7 @@ describe('Base editor', () => {
expect(modelSpy).not.toHaveBeenCalled();
expect(instanceSpy).not.toHaveBeenCalled();
expect(EditorLite.decorateInstance).not.toHaveBeenCalled();
expect(EditorLite.convertMonacoToELInstance).not.toHaveBeenCalled();
});
it('creates model to be supplied to Monaco editor', () => {
......@@ -592,7 +592,7 @@ describe('Base editor', () => {
const useSpy = jest.fn().mockImplementation(() => {
calls.push('use');
});
jest.spyOn(EditorLite, 'decorateInstance').mockImplementation((inst) => {
jest.spyOn(EditorLite, 'convertMonacoToELInstance').mockImplementation((inst) => {
const decoratedInstance = inst;
decoratedInstance.use = useSpy;
return decoratedInstance;
......
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