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
0fdcb703
Commit
0fdcb703
authored
Jul 26, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix repo_editor_spec because of async loader changes
parent
a6a7a0e1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
4 deletions
+17
-4
app/assets/javascripts/repo/index.js
app/assets/javascripts/repo/index.js
+2
-2
app/assets/javascripts/repo/repo_editor.js
app/assets/javascripts/repo/repo_editor.js
+5
-2
spec/javascripts/repo/repo_editor_spec.js
spec/javascripts/repo/repo_editor_spec.js
+10
-0
No files found.
app/assets/javascripts/repo/index.js
View file @
0fdcb703
...
...
@@ -9,7 +9,7 @@ import RepoCommitSection from './repo_commit_section.vue';
import
RepoTabs
from
'
./repo_tabs.vue
'
;
import
RepoFileButtons
from
'
./repo_file_buttons.vue
'
;
import
RepoBinaryViewer
from
'
./repo_binary_viewer.vue
'
;
import
RepoEditor
from
'
./repo_editor
'
;
import
{
repoEditorLoader
}
from
'
./repo_editor
'
;
import
RepoMiniMixin
from
'
./repo_mini_mixin
'
;
function
initRepo
()
{
...
...
@@ -44,7 +44,7 @@ function initRepo() {
'
repo-tabs
'
:
RepoTabs
,
'
repo-file-buttons
'
:
RepoFileButtons
,
'
repo-binary-viewer
'
:
RepoBinaryViewer
,
'
repo-editor
'
:
RepoEdito
r
,
'
repo-editor
'
:
repoEditorLoade
r
,
'
repo-commit-section
'
:
RepoCommitSection
,
},
});
...
...
app/assets/javascripts/repo/repo_editor.js
View file @
0fdcb703
...
...
@@ -106,7 +106,7 @@ const RepoEditor = {
},
};
function
asyncLoadRepoEdito
r
()
{
function
repoEditorLoade
r
()
{
return
new
Promise
((
resolve
)
=>
{
monacoLoader
([
'
vs/editor/editor.main
'
],
()
=>
{
Store
.
monaco
=
monaco
;
...
...
@@ -116,4 +116,7 @@ function asyncLoadRepoEditor() {
});
}
export
default
asyncLoadRepoEditor
;
export
{
RepoEditor
as
default
,
repoEditorLoader
,
};
spec/javascripts/repo/repo_editor_spec.js
View file @
0fdcb703
import
Vue
from
'
vue
'
;
import
repoEditor
from
'
~/repo/repo_editor
'
;
import
RepoStore
from
'
~/repo/repo_store
'
;
describe
(
'
RepoEditor
'
,
()
=>
{
function
createComponent
()
{
...
...
@@ -9,6 +10,15 @@ describe('RepoEditor', () => {
}
it
(
'
renders an ide container
'
,
()
=>
{
const
monacoInstance
=
jasmine
.
createSpyObj
(
'
monacoInstance
'
,
[
'
onMouseUp
'
,
'
onKeyUp
'
,
'
setModel
'
]);
const
monaco
=
{
editor
:
jasmine
.
createSpyObj
(
'
editor
'
,
[
'
create
'
]),
};
RepoStore
.
monaco
=
monaco
;
monaco
.
editor
.
create
.
and
.
returnValue
(
monacoInstance
);
spyOn
(
repoEditor
.
watch
,
'
blobRaw
'
);
const
vm
=
createComponent
();
expect
(
vm
.
$el
.
id
).
toEqual
(
'
ide
'
);
...
...
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