BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
index.js
app/assets/javascripts/groups/index.js
+2
-2
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,12 +94,12 @@ document.addEventListener('DOMContentLoaded', () => {
...
@@ -94,12 +94,12 @@ 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
);
this
.
updateGroups
(
response
.
json
());
this
.
updateGroups
(
response
.
json
());
this
.
updatePagination
(
response
.
headers
);
this
.
updatePagination
(
response
.
headers
);
})
})
.
catch
(
this
.
handleErrorResponse
);
.
catch
(
this
.
handleErrorResponse
);
...
...
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