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
f1d48c25
Commit
f1d48c25
authored
May 05, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix failing spec and eslint
parent
48e49919
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
21 deletions
+27
-21
spec/javascripts/helpers/user_mock_data_helper.js
spec/javascripts/helpers/user_mock_data_helper.js
+1
-1
spec/javascripts/sidebar/assignees_spec.js
spec/javascripts/sidebar/assignees_spec.js
+6
-6
spec/javascripts/sidebar/mock_data.js
spec/javascripts/sidebar/mock_data.js
+1
-1
spec/javascripts/sidebar/sidebar_mediator_spec.js
spec/javascripts/sidebar/sidebar_mediator_spec.js
+6
-4
spec/javascripts/sidebar/sidebar_service_spec.js
spec/javascripts/sidebar/sidebar_service_spec.js
+12
-8
spec/javascripts/sidebar/sidebar_store_spec.js
spec/javascripts/sidebar/sidebar_store_spec.js
+1
-1
No files found.
spec/javascripts/
sidebar/user_mock_data
.js
→
spec/javascripts/
helpers/user_mock_data_helper
.js
View file @
f1d48c25
...
...
@@ -4,7 +4,7 @@ export default {
for
(
let
i
=
0
;
i
<
numberUsers
;
i
=
i
+=
1
)
{
users
.
push
(
{
avatar
Url
:
'
http://gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon
'
,
avatar
:
'
http://gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon
'
,
id
:
(
i
+
1
),
name
:
`GitLab User
${
i
}
`
,
username
:
`gitlab
${
i
}
`
,
...
...
spec/javascripts/sidebar/assignees_spec.js
View file @
f1d48c25
import
Vue
from
'
vue
'
;
import
Assignee
from
'
~/sidebar/components/assignees/assignees
'
;
import
UsersMock
from
'
./mock_data
'
;
import
UsersMockHelper
from
'
../
test_helpers/user_mock_data
'
;
import
UsersMockHelper
from
'
../
helpers/user_mock_data_helper
'
;
describe
(
'
Assignee component
'
,
()
=>
{
let
component
;
...
...
@@ -86,7 +86,7 @@ describe('Assignee component', () => {
const
collapsed
=
component
.
$el
.
querySelector
(
'
.sidebar-collapsed-icon
'
);
const
assignee
=
collapsed
.
children
[
0
];
expect
(
collapsed
.
childElementCount
).
toEqual
(
1
);
expect
(
assignee
.
querySelector
(
'
.avatar
'
).
getAttribute
(
'
src
'
)).
toEqual
(
UsersMock
.
user
.
avatar
Url
);
expect
(
assignee
.
querySelector
(
'
.avatar
'
).
getAttribute
(
'
src
'
)).
toEqual
(
UsersMock
.
user
.
avatar
);
expect
(
assignee
.
querySelector
(
'
.avatar
'
).
getAttribute
(
'
alt
'
)).
toEqual
(
`
${
UsersMock
.
user
.
name
}
's avatar`
);
expect
(
assignee
.
querySelector
(
'
.author
'
).
innerText
.
trim
()).
toEqual
(
UsersMock
.
user
.
name
);
});
...
...
@@ -104,7 +104,7 @@ describe('Assignee component', () => {
expect
(
component
.
$el
.
querySelector
(
'
.author_link
'
)).
not
.
toBeNull
();
// The image
expect
(
component
.
$el
.
querySelector
(
'
.author_link img
'
).
getAttribute
(
'
src
'
)).
toEqual
(
UsersMock
.
user
.
avatar
Url
);
expect
(
component
.
$el
.
querySelector
(
'
.author_link img
'
).
getAttribute
(
'
src
'
)).
toEqual
(
UsersMock
.
user
.
avatar
);
// Author name
expect
(
component
.
$el
.
querySelector
(
'
.author_link .author
'
).
innerText
.
trim
()).
toEqual
(
UsersMock
.
user
.
name
);
// Username
...
...
@@ -141,12 +141,12 @@ describe('Assignee component', () => {
expect
(
collapsed
.
childElementCount
).
toEqual
(
2
);
const
first
=
collapsed
.
children
[
0
];
expect
(
first
.
querySelector
(
'
.avatar
'
).
getAttribute
(
'
src
'
)).
toEqual
(
users
[
0
].
avatar
Url
);
expect
(
first
.
querySelector
(
'
.avatar
'
).
getAttribute
(
'
src
'
)).
toEqual
(
users
[
0
].
avatar
);
expect
(
first
.
querySelector
(
'
.avatar
'
).
getAttribute
(
'
alt
'
)).
toEqual
(
`
${
users
[
0
].
name
}
's avatar`
);
expect
(
first
.
querySelector
(
'
.author
'
).
innerText
.
trim
()).
toEqual
(
users
[
0
].
name
);
const
second
=
collapsed
.
children
[
1
];
expect
(
second
.
querySelector
(
'
.avatar
'
).
getAttribute
(
'
src
'
)).
toEqual
(
users
[
1
].
avatar
Url
);
expect
(
second
.
querySelector
(
'
.avatar
'
).
getAttribute
(
'
src
'
)).
toEqual
(
users
[
1
].
avatar
);
expect
(
second
.
querySelector
(
'
.avatar
'
).
getAttribute
(
'
alt
'
)).
toEqual
(
`
${
users
[
1
].
name
}
's avatar`
);
expect
(
second
.
querySelector
(
'
.author
'
).
innerText
.
trim
()).
toEqual
(
users
[
1
].
name
);
});
...
...
@@ -165,7 +165,7 @@ describe('Assignee component', () => {
expect
(
collapsed
.
childElementCount
).
toEqual
(
2
);
const
first
=
collapsed
.
children
[
0
];
expect
(
first
.
querySelector
(
'
.avatar
'
).
getAttribute
(
'
src
'
)).
toEqual
(
users
[
0
].
avatar
Url
);
expect
(
first
.
querySelector
(
'
.avatar
'
).
getAttribute
(
'
src
'
)).
toEqual
(
users
[
0
].
avatar
);
expect
(
first
.
querySelector
(
'
.avatar
'
).
getAttribute
(
'
alt
'
)).
toEqual
(
`
${
users
[
0
].
name
}
's avatar`
);
expect
(
first
.
querySelector
(
'
.author
'
).
innerText
.
trim
()).
toEqual
(
users
[
0
].
name
);
...
...
spec/javascripts/sidebar/mock_data.js
View file @
f1d48c25
...
...
@@ -93,7 +93,7 @@ export default {
human_total_time_spent
:
null
,
},
user
:
{
avatar
Url
:
'
http://gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon
'
,
avatar
:
'
http://gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon
'
,
id
:
1
,
name
:
'
Administrator
'
,
username
:
'
root
'
,
...
...
spec/javascripts/sidebar/sidebar_mediator_spec.js
View file @
f1d48c25
...
...
@@ -24,10 +24,12 @@ describe('Sidebar mediator', () => {
});
it
(
'
saves assignees
'
,
(
done
)
=>
{
this
.
mediator
.
saveAssignees
(
'
issue[assignee_ids]
'
).
then
((
resp
)
=>
{
this
.
mediator
.
saveAssignees
(
'
issue[assignee_ids]
'
)
.
then
((
resp
)
=>
{
expect
(
resp
.
status
).
toEqual
(
200
);
done
();
});
})
.
catch
(()
=>
{});
});
it
(
'
fetches the data
'
,
()
=>
{
...
...
spec/javascripts/sidebar/sidebar_service_spec.js
View file @
f1d48c25
...
...
@@ -13,16 +13,20 @@ describe('Sidebar service', () => {
});
it
(
'
gets the data
'
,
(
done
)
=>
{
this
.
service
.
get
().
then
((
resp
)
=>
{
this
.
service
.
get
()
.
then
((
resp
)
=>
{
expect
(
resp
).
toBeDefined
();
done
();
});
})
.
catch
(()
=>
{});
});
it
(
'
updates the data
'
,
(
done
)
=>
{
this
.
service
.
update
(
'
issue[assignee_ids]
'
,
[
1
]).
then
((
resp
)
=>
{
this
.
service
.
update
(
'
issue[assignee_ids]
'
,
[
1
])
.
then
((
resp
)
=>
{
expect
(
resp
).
toBeDefined
();
done
();
});
})
.
catch
(()
=>
{});
});
});
spec/javascripts/sidebar/sidebar_store_spec.js
View file @
f1d48c25
import
SidebarStore
from
'
~/sidebar/stores/sidebar_store
'
;
import
Mock
from
'
./mock_data
'
;
import
UsersMockHelper
from
'
../
test_helpers/user_mock_data
'
;
import
UsersMockHelper
from
'
../
helpers/user_mock_data_helper
'
;
describe
(
'
Sidebar store
'
,
()
=>
{
const
assignee
=
{
...
...
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