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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
ea680b73
Commit
ea680b73
authored
Apr 26, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
specs
parent
c83ed559
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
142 additions
and
5 deletions
+142
-5
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+8
-2
spec/javascripts/ide/components/activity_bar_spec.js
spec/javascripts/ide/components/activity_bar_spec.js
+6
-0
spec/javascripts/ide/components/ide_review_spec.js
spec/javascripts/ide/components/ide_review_spec.js
+33
-0
spec/javascripts/ide/components/ide_tree_list_spec.js
spec/javascripts/ide/components/ide_tree_list_spec.js
+54
-0
spec/javascripts/ide/components/repo_file_spec.js
spec/javascripts/ide/components/repo_file_spec.js
+41
-3
No files found.
app/assets/stylesheets/pages/repo.scss
View file @
ea680b73
...
...
@@ -282,8 +282,14 @@
opacity
:
0
.4
;
}
.editor.original
.cursors-layer
{
display
:
none
;
.editor.original
{
.view-lines
{
cursor
:
default
;
}
.cursors-layer
{
display
:
none
;
}
}
}
}
...
...
spec/javascripts/ide/components/activity_bar_spec.js
View file @
ea680b73
...
...
@@ -62,6 +62,12 @@ describe('IDE activity bar', () => {
expect
(
vm
.
updateActivityBarView
).
toHaveBeenCalledWith
(
ActivityBarViews
.
commit
);
});
it
(
'
calls updateActivityBarView with review value on click
'
,
()
=>
{
vm
.
$el
.
querySelector
(
'
.js-ide-review-mode
'
).
click
();
expect
(
vm
.
updateActivityBarView
).
toHaveBeenCalledWith
(
ActivityBarViews
.
review
);
});
});
describe
(
'
active item
'
,
()
=>
{
...
...
spec/javascripts/ide/components/ide_review_spec.js
0 → 100644
View file @
ea680b73
import
Vue
from
'
vue
'
;
import
IdeReview
from
'
~/ide/components/ide_review.vue
'
;
import
store
from
'
~/ide/stores
'
;
import
{
createComponentWithStore
}
from
'
../../helpers/vue_mount_component_helper
'
;
import
{
resetStore
,
file
}
from
'
../helpers
'
;
import
{
projectData
}
from
'
../mock_data
'
;
describe
(
'
IDE review mode
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
IdeReview
);
let
vm
;
beforeEach
(()
=>
{
store
.
state
.
currentProjectId
=
'
abcproject
'
;
store
.
state
.
currentBranchId
=
'
master
'
;
store
.
state
.
projects
.
abcproject
=
Object
.
assign
({},
projectData
);
Vue
.
set
(
store
.
state
.
trees
,
'
abcproject/master
'
,
{
tree
:
[
file
(
'
fileName
'
)],
loading
:
false
,
});
vm
=
createComponentWithStore
(
Component
,
store
).
$mount
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
resetStore
(
vm
.
$store
);
});
it
(
'
renders list of files
'
,
()
=>
{
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
fileName
'
);
});
});
spec/javascripts/ide/components/ide_tree_list_spec.js
0 → 100644
View file @
ea680b73
import
Vue
from
'
vue
'
;
import
IdeTreeList
from
'
~/ide/components/ide_tree_list.vue
'
;
import
store
from
'
~/ide/stores
'
;
import
{
createComponentWithStore
}
from
'
../../helpers/vue_mount_component_helper
'
;
import
{
resetStore
,
file
}
from
'
../helpers
'
;
import
{
projectData
}
from
'
../mock_data
'
;
describe
(
'
IDE tree list
'
,
()
=>
{
const
Component
=
Vue
.
extend
(
IdeTreeList
);
let
vm
;
beforeEach
(()
=>
{
store
.
state
.
currentProjectId
=
'
abcproject
'
;
store
.
state
.
currentBranchId
=
'
master
'
;
store
.
state
.
projects
.
abcproject
=
Object
.
assign
({},
projectData
);
Vue
.
set
(
store
.
state
.
trees
,
'
abcproject/master
'
,
{
tree
:
[
file
(
'
fileName
'
)],
loading
:
false
,
});
vm
=
createComponentWithStore
(
Component
,
store
,
{
viewerType
:
'
edit
'
,
});
spyOn
(
vm
,
'
updateViewer
'
).
and
.
callThrough
();
vm
.
$mount
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
resetStore
(
vm
.
$store
);
});
it
(
'
updates viewer on mount
'
,
()
=>
{
expect
(
vm
.
updateViewer
).
toHaveBeenCalledWith
(
'
edit
'
);
});
it
(
'
renders loading indicator
'
,
done
=>
{
store
.
state
.
trees
[
'
abcproject/master
'
].
loading
=
true
;
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.multi-file-loading-container
'
)).
not
.
toBeNull
();
expect
(
vm
.
$el
.
querySelectorAll
(
'
.multi-file-loading-container
'
).
length
).
toBe
(
3
);
done
();
});
});
it
(
'
renders list of files
'
,
()
=>
{
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
fileName
'
);
});
});
spec/javascripts/ide/components/repo_file_spec.js
View file @
ea680b73
...
...
@@ -5,7 +5,7 @@ import router from '~/ide/ide_router';
import
{
createComponentWithStore
}
from
'
../../helpers/vue_mount_component_helper
'
;
import
{
file
}
from
'
../helpers
'
;
describe
(
'
RepoFile
'
,
()
=>
{
f
describe
(
'
RepoFile
'
,
()
=>
{
let
vm
;
function
createComponent
(
propsData
)
{
...
...
@@ -72,9 +72,47 @@ describe('RepoFile', () => {
it
(
'
renders a tooltip
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.ide-file-name span:nth-child(2)
'
).
dataset
.
originalTitle
,
vm
.
$el
.
querySelector
(
'
.ide-file-name span:nth-child(2)
'
).
dataset
.
originalTitle
,
).
toContain
(
'
Locked by testuser
'
);
});
});
describe
(
'
folder
'
,
()
=>
{
it
(
'
renders action dropdown
'
,
done
=>
{
createComponent
({
file
:
{
...
file
(
'
t4
'
),
type
:
'
tree
'
,
branchId
:
'
master
'
,
projectId
:
'
project
'
,
},
level
:
0
,
});
setTimeout
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.ide-new-btn
'
)).
not
.
toBeNull
();
done
();
});
});
it
(
'
disables action dropdown
'
,
done
=>
{
createComponent
({
file
:
{
...
file
(
'
t4
'
),
type
:
'
tree
'
,
branchId
:
'
master
'
,
projectId
:
'
project
'
,
},
level
:
0
,
disableActionDropdown
:
true
,
});
setTimeout
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.ide-new-btn
'
)).
toBeNull
();
done
();
});
});
});
});
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