Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7e78bc41
Commit
7e78bc41
authored
Feb 03, 2021
by
Denys Mishunov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed decorateInstance to convertMonacoToELInstance
As per review
parent
38f794b9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
app/assets/javascripts/editor/editor_lite.js
app/assets/javascripts/editor/editor_lite.js
+2
-2
spec/frontend/editor/editor_lite_spec.js
spec/frontend/editor/editor_lite_spec.js
+3
-3
No files found.
app/assets/javascripts/editor/editor_lite.js
View file @
7e78bc41
...
@@ -134,7 +134,7 @@ export default class EditorLite {
...
@@ -134,7 +134,7 @@ export default class EditorLite {
return
diffModel
;
return
diffModel
;
}
}
static
decorate
Instance
=
(
inst
)
=>
{
static
convertMonacoToEL
Instance
=
(
inst
)
=>
{
const
decoratedInstance
=
inst
;
const
decoratedInstance
=
inst
;
decoratedInstance
.
updateModelLanguage
=
(
path
)
=>
{
decoratedInstance
.
updateModelLanguage
=
(
path
)
=>
{
const
lang
=
EditorLite
.
getModelLanguage
(
path
);
const
lang
=
EditorLite
.
getModelLanguage
(
path
);
...
@@ -194,7 +194,7 @@ export default class EditorLite {
...
@@ -194,7 +194,7 @@ export default class EditorLite {
let
model
;
let
model
;
const
createEditorFn
=
diff
?
'
createDiffEditor
'
:
'
create
'
;
const
createEditorFn
=
diff
?
'
createDiffEditor
'
:
'
create
'
;
const
instance
=
EditorLite
.
decorate
Instance
(
const
instance
=
EditorLite
.
convertMonacoToEL
Instance
(
monacoEditor
[
createEditorFn
].
call
(
this
,
el
,
{
monacoEditor
[
createEditorFn
].
call
(
this
,
el
,
{
...
this
.
options
,
...
this
.
options
,
...
instanceOptions
,
...
instanceOptions
,
...
...
spec/frontend/editor/editor_lite_spec.js
View file @
7e78bc41
...
@@ -58,7 +58,7 @@ describe('Base editor', () => {
...
@@ -58,7 +58,7 @@ describe('Base editor', () => {
modelSpy
=
jest
.
spyOn
(
monacoEditor
,
'
createModel
'
).
mockImplementation
(()
=>
res
);
modelSpy
=
jest
.
spyOn
(
monacoEditor
,
'
createModel
'
).
mockImplementation
(()
=>
res
);
};
};
const
mockDecorateInstance
=
(
decorations
)
=>
{
const
mockDecorateInstance
=
(
decorations
)
=>
{
jest
.
spyOn
(
EditorLite
,
'
decorate
Instance
'
).
mockImplementation
((
inst
)
=>
{
jest
.
spyOn
(
EditorLite
,
'
convertMonacoToEL
Instance
'
).
mockImplementation
((
inst
)
=>
{
return
Object
.
assign
(
inst
,
decorations
);
return
Object
.
assign
(
inst
,
decorations
);
});
});
};
};
...
@@ -82,7 +82,7 @@ describe('Base editor', () => {
...
@@ -82,7 +82,7 @@ describe('Base editor', () => {
expect
(
modelSpy
).
not
.
toHaveBeenCalled
();
expect
(
modelSpy
).
not
.
toHaveBeenCalled
();
expect
(
instanceSpy
).
not
.
toHaveBeenCalled
();
expect
(
instanceSpy
).
not
.
toHaveBeenCalled
();
expect
(
EditorLite
.
decorate
Instance
).
not
.
toHaveBeenCalled
();
expect
(
EditorLite
.
convertMonacoToEL
Instance
).
not
.
toHaveBeenCalled
();
});
});
it
(
'
creates model to be supplied to Monaco editor
'
,
()
=>
{
it
(
'
creates model to be supplied to Monaco editor
'
,
()
=>
{
...
@@ -592,7 +592,7 @@ describe('Base editor', () => {
...
@@ -592,7 +592,7 @@ describe('Base editor', () => {
const
useSpy
=
jest
.
fn
().
mockImplementation
(()
=>
{
const
useSpy
=
jest
.
fn
().
mockImplementation
(()
=>
{
calls
.
push
(
'
use
'
);
calls
.
push
(
'
use
'
);
});
});
jest
.
spyOn
(
EditorLite
,
'
decorate
Instance
'
).
mockImplementation
((
inst
)
=>
{
jest
.
spyOn
(
EditorLite
,
'
convertMonacoToEL
Instance
'
).
mockImplementation
((
inst
)
=>
{
const
decoratedInstance
=
inst
;
const
decoratedInstance
=
inst
;
decoratedInstance
.
use
=
useSpy
;
decoratedInstance
.
use
=
useSpy
;
return
decoratedInstance
;
return
decoratedInstance
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment