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
Léo-Paul Géneau
gitlab-ce
Commits
c24b7068
Commit
c24b7068
authored
Jun 08, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests when user has no direct acces to a group
parent
f427bf42
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
app/assets/javascripts/groups/index.js
app/assets/javascripts/groups/index.js
+2
-2
spec/javascripts/groups/group_item_spec.js
spec/javascripts/groups/group_item_spec.js
+31
-0
No files found.
app/assets/javascripts/groups/index.js
View file @
c24b7068
...
@@ -94,7 +94,7 @@ document.addEventListener('DOMContentLoaded', () => {
...
@@ -94,7 +94,7 @@ document.addEventListener('DOMContentLoaded', () => {
this
.
isLoading
=
false
;
this
.
isLoading
=
false
;
$
.
scrollTo
(
0
);
$
.
scrollTo
(
0
);
const
currentPath
=
gl
.
utils
.
mergeUrlParams
({
page
:
page
},
window
.
location
.
href
);
const
currentPath
=
gl
.
utils
.
mergeUrlParams
({
page
},
window
.
location
.
href
);
window
.
history
.
replaceState
({
window
.
history
.
replaceState
({
page
:
currentPath
,
page
:
currentPath
,
},
document
.
title
,
currentPath
);
},
document
.
title
,
currentPath
);
...
...
spec/javascripts/groups/group_item_spec.js
View file @
c24b7068
...
@@ -63,9 +63,40 @@ describe('Groups Component', () => {
...
@@ -63,9 +63,40 @@ describe('Groups Component', () => {
});
});
});
});
afterEach
(()
=>
{
component
.
$destroy
();
});
it
(
'
should render group item correctly
'
,
()
=>
{
it
(
'
should render group item correctly
'
,
()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.description
'
).
textContent
).
toBe
(
''
);
expect
(
component
.
$el
.
querySelector
(
'
.description
'
).
textContent
).
toBe
(
''
);
expect
(
component
.
$el
.
classList
.
contains
(
'
.no-description
'
)).
toBe
(
false
);
expect
(
component
.
$el
.
classList
.
contains
(
'
.no-description
'
)).
toBe
(
false
);
});
});
});
});
describe
(
'
user has not access to group
'
,
()
=>
{
beforeEach
((
done
)
=>
{
GroupItemComponent
=
Vue
.
extend
(
groupItemComponent
);
store
=
new
GroupsStore
();
group1
.
permissions
.
human_group_access
=
null
;
group
=
store
.
decorateGroup
(
group1
);
component
=
new
GroupItemComponent
({
propsData
:
{
group
,
},
}).
$mount
();
Vue
.
nextTick
(()
=>
{
done
();
});
});
afterEach
(()
=>
{
component
.
$destroy
();
});
it
(
'
should not display access type
'
,
()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.access-type
'
)).
toBeNull
();
});
});
});
});
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