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
7c20403f
Commit
7c20403f
authored
Apr 07, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed failing tests because of passed `null`
added spec to check for `head` file
parent
4581a78d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
3 deletions
+30
-3
app/assets/javascripts/ide/components/repo_editor.vue
app/assets/javascripts/ide/components/repo_editor.vue
+1
-1
spec/javascripts/ide/components/repo_editor_spec.js
spec/javascripts/ide/components/repo_editor_spec.js
+15
-1
spec/javascripts/ide/lib/common/model_spec.js
spec/javascripts/ide/lib/common/model_spec.js
+13
-0
spec/javascripts/ide/lib/editor_spec.js
spec/javascripts/ide/lib/editor_spec.js
+1
-1
No files found.
app/assets/javascripts/ide/components/repo_editor.vue
View file @
7c20403f
...
...
@@ -19,7 +19,7 @@ export default {
},
},
computed
:
{
...
mapState
([
'
rightPanelCollapsed
'
,
'
viewer
'
,
'
delayViewerUpdated
'
]),
...
mapState
([
'
rightPanelCollapsed
'
,
'
viewer
'
,
'
delayViewerUpdated
'
,
'
panelResizing
'
]),
...
mapGetters
([
'
currentMergeRequest
'
,
'
getStagedFile
'
]),
shouldHideEditor
()
{
return
this
.
file
&&
this
.
file
.
binary
&&
!
this
.
file
.
raw
;
...
...
spec/javascripts/ide/components/repo_editor_spec.js
View file @
7c20403f
...
...
@@ -163,7 +163,7 @@ describe('RepoEditor', () => {
vm
.
setupEditor
();
expect
(
vm
.
editor
.
createModel
).
toHaveBeenCalledWith
(
vm
.
file
);
expect
(
vm
.
editor
.
createModel
).
toHaveBeenCalledWith
(
vm
.
file
,
null
);
expect
(
vm
.
model
).
not
.
toBeNull
();
});
...
...
@@ -197,6 +197,20 @@ describe('RepoEditor', () => {
done
();
});
});
it
(
'
sets head model as staged file
'
,
()
=>
{
spyOn
(
vm
.
editor
,
'
createModel
'
).
and
.
callThrough
();
Editor
.
editorInstance
.
modelManager
.
dispose
();
vm
.
$store
.
state
.
stagedFiles
.
push
({
...
vm
.
file
,
key
:
'
staged
'
});
vm
.
file
.
staged
=
true
;
vm
.
file
.
key
=
`unstaged-
${
vm
.
file
.
key
}
`
;
vm
.
setupEditor
();
expect
(
vm
.
editor
.
createModel
).
toHaveBeenCalledWith
(
vm
.
file
,
vm
.
$store
.
state
.
stagedFiles
[
0
]);
});
});
describe
(
'
editor updateDimensions
'
,
()
=>
{
...
...
spec/javascripts/ide/lib/common/model_spec.js
View file @
7c20403f
...
...
@@ -30,6 +30,19 @@ describe('Multi-file editor library model', () => {
expect
(
model
.
baseModel
).
not
.
toBeNull
();
});
it
(
'
creates model with head file to compare against
'
,
()
=>
{
const
f
=
file
(
'
path
'
);
model
.
dispose
();
model
=
new
Model
(
monaco
,
f
,
{
...
f
,
content
:
'
123 testing
'
,
});
expect
(
model
.
head
).
not
.
toBeNull
();
expect
(
model
.
getOriginalModel
().
getValue
()).
toBe
(
'
123 testing
'
);
});
it
(
'
adds eventHub listener
'
,
()
=>
{
expect
(
eventHub
.
$on
).
toHaveBeenCalledWith
(
`editor.update.model.dispose.
${
model
.
file
.
key
}
`
,
...
...
spec/javascripts/ide/lib/editor_spec.js
View file @
7c20403f
...
...
@@ -88,7 +88,7 @@ describe('Multi-file editor library', () => {
instance
.
createModel
(
'
FILE
'
);
expect
(
instance
.
modelManager
.
addModel
).
toHaveBeenCalledWith
(
'
FILE
'
);
expect
(
instance
.
modelManager
.
addModel
).
toHaveBeenCalledWith
(
'
FILE
'
,
null
);
});
});
...
...
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