Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
f1d48c25
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f1d48c25
编写于
5月 05, 2017
作者:
C
Clement Ho
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix failing spec and eslint
上级
48e49919
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
27 addition
and
21 deletion
+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
未找到文件。
spec/javascripts/
sidebar/user_mock_data
.js
→
spec/javascripts/
helpers/user_mock_data_helper
.js
浏览文件 @
f1d48c25
...
@@ -4,7 +4,7 @@ export default {
...
@@ -4,7 +4,7 @@ export default {
for
(
let
i
=
0
;
i
<
numberUsers
;
i
=
i
+=
1
)
{
for
(
let
i
=
0
;
i
<
numberUsers
;
i
=
i
+=
1
)
{
users
.
push
(
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
),
id
:
(
i
+
1
),
name
:
`GitLab User
${
i
}
`
,
name
:
`GitLab User
${
i
}
`
,
username
:
`gitlab
${
i
}
`
,
username
:
`gitlab
${
i
}
`
,
...
...
spec/javascripts/sidebar/assignees_spec.js
浏览文件 @
f1d48c25
import
Vue
from
'
vue
'
;
import
Vue
from
'
vue
'
;
import
Assignee
from
'
~/sidebar/components/assignees/assignees
'
;
import
Assignee
from
'
~/sidebar/components/assignees/assignees
'
;
import
UsersMock
from
'
./mock_data
'
;
import
UsersMock
from
'
./mock_data
'
;
import
UsersMockHelper
from
'
../
test_helpers/user_mock_data
'
;
import
UsersMockHelper
from
'
../
helpers/user_mock_data_helper
'
;
describe
(
'
Assignee component
'
,
()
=>
{
describe
(
'
Assignee component
'
,
()
=>
{
let
component
;
let
component
;
...
@@ -86,7 +86,7 @@ describe('Assignee component', () => {
...
@@ -86,7 +86,7 @@ describe('Assignee component', () => {
const
collapsed
=
component
.
$el
.
querySelector
(
'
.sidebar-collapsed-icon
'
);
const
collapsed
=
component
.
$el
.
querySelector
(
'
.sidebar-collapsed-icon
'
);
const
assignee
=
collapsed
.
children
[
0
];
const
assignee
=
collapsed
.
children
[
0
];
expect
(
collapsed
.
childElementCount
).
toEqual
(
1
);
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
(
'
.avatar
'
).
getAttribute
(
'
alt
'
)).
toEqual
(
`
${
UsersMock
.
user
.
name
}
's avatar`
);
expect
(
assignee
.
querySelector
(
'
.author
'
).
innerText
.
trim
()).
toEqual
(
UsersMock
.
user
.
name
);
expect
(
assignee
.
querySelector
(
'
.author
'
).
innerText
.
trim
()).
toEqual
(
UsersMock
.
user
.
name
);
});
});
...
@@ -104,7 +104,7 @@ describe('Assignee component', () => {
...
@@ -104,7 +104,7 @@ describe('Assignee component', () => {
expect
(
component
.
$el
.
querySelector
(
'
.author_link
'
)).
not
.
toBeNull
();
expect
(
component
.
$el
.
querySelector
(
'
.author_link
'
)).
not
.
toBeNull
();
// The image
// 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
// Author name
expect
(
component
.
$el
.
querySelector
(
'
.author_link .author
'
).
innerText
.
trim
()).
toEqual
(
UsersMock
.
user
.
name
);
expect
(
component
.
$el
.
querySelector
(
'
.author_link .author
'
).
innerText
.
trim
()).
toEqual
(
UsersMock
.
user
.
name
);
// Username
// Username
...
@@ -141,12 +141,12 @@ describe('Assignee component', () => {
...
@@ -141,12 +141,12 @@ describe('Assignee component', () => {
expect
(
collapsed
.
childElementCount
).
toEqual
(
2
);
expect
(
collapsed
.
childElementCount
).
toEqual
(
2
);
const
first
=
collapsed
.
children
[
0
];
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
(
'
.avatar
'
).
getAttribute
(
'
alt
'
)).
toEqual
(
`
${
users
[
0
].
name
}
's avatar`
);
expect
(
first
.
querySelector
(
'
.author
'
).
innerText
.
trim
()).
toEqual
(
users
[
0
].
name
);
expect
(
first
.
querySelector
(
'
.author
'
).
innerText
.
trim
()).
toEqual
(
users
[
0
].
name
);
const
second
=
collapsed
.
children
[
1
];
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
(
'
.avatar
'
).
getAttribute
(
'
alt
'
)).
toEqual
(
`
${
users
[
1
].
name
}
's avatar`
);
expect
(
second
.
querySelector
(
'
.author
'
).
innerText
.
trim
()).
toEqual
(
users
[
1
].
name
);
expect
(
second
.
querySelector
(
'
.author
'
).
innerText
.
trim
()).
toEqual
(
users
[
1
].
name
);
});
});
...
@@ -165,7 +165,7 @@ describe('Assignee component', () => {
...
@@ -165,7 +165,7 @@ describe('Assignee component', () => {
expect
(
collapsed
.
childElementCount
).
toEqual
(
2
);
expect
(
collapsed
.
childElementCount
).
toEqual
(
2
);
const
first
=
collapsed
.
children
[
0
];
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
(
'
.avatar
'
).
getAttribute
(
'
alt
'
)).
toEqual
(
`
${
users
[
0
].
name
}
's avatar`
);
expect
(
first
.
querySelector
(
'
.author
'
).
innerText
.
trim
()).
toEqual
(
users
[
0
].
name
);
expect
(
first
.
querySelector
(
'
.author
'
).
innerText
.
trim
()).
toEqual
(
users
[
0
].
name
);
...
...
spec/javascripts/sidebar/mock_data.js
浏览文件 @
f1d48c25
...
@@ -93,7 +93,7 @@ export default {
...
@@ -93,7 +93,7 @@ export default {
human_total_time_spent
:
null
,
human_total_time_spent
:
null
,
},
},
user
:
{
user
:
{
avatar
Url
:
'
http://gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon
'
,
avatar
:
'
http://gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon
'
,
id
:
1
,
id
:
1
,
name
:
'
Administrator
'
,
name
:
'
Administrator
'
,
username
:
'
root
'
,
username
:
'
root
'
,
...
...
spec/javascripts/sidebar/sidebar_mediator_spec.js
浏览文件 @
f1d48c25
...
@@ -24,10 +24,12 @@ describe('Sidebar mediator', () => {
...
@@ -24,10 +24,12 @@ describe('Sidebar mediator', () => {
});
});
it
(
'
saves assignees
'
,
(
done
)
=>
{
it
(
'
saves assignees
'
,
(
done
)
=>
{
this
.
mediator
.
saveAssignees
(
'
issue[assignee_ids]
'
).
then
((
resp
)
=>
{
this
.
mediator
.
saveAssignees
(
'
issue[assignee_ids]
'
)
expect
(
resp
.
status
).
toEqual
(
200
);
.
then
((
resp
)
=>
{
done
();
expect
(
resp
.
status
).
toEqual
(
200
);
});
done
();
})
.
catch
(()
=>
{});
});
});
it
(
'
fetches the data
'
,
()
=>
{
it
(
'
fetches the data
'
,
()
=>
{
...
...
spec/javascripts/sidebar/sidebar_service_spec.js
浏览文件 @
f1d48c25
...
@@ -13,16 +13,20 @@ describe('Sidebar service', () => {
...
@@ -13,16 +13,20 @@ describe('Sidebar service', () => {
});
});
it
(
'
gets the data
'
,
(
done
)
=>
{
it
(
'
gets the data
'
,
(
done
)
=>
{
this
.
service
.
get
().
then
((
resp
)
=>
{
this
.
service
.
get
()
expect
(
resp
).
toBeDefined
();
.
then
((
resp
)
=>
{
done
();
expect
(
resp
).
toBeDefined
();
});
done
();
})
.
catch
(()
=>
{});
});
});
it
(
'
updates the data
'
,
(
done
)
=>
{
it
(
'
updates the data
'
,
(
done
)
=>
{
this
.
service
.
update
(
'
issue[assignee_ids]
'
,
[
1
]).
then
((
resp
)
=>
{
this
.
service
.
update
(
'
issue[assignee_ids]
'
,
[
1
])
expect
(
resp
).
toBeDefined
();
.
then
((
resp
)
=>
{
done
();
expect
(
resp
).
toBeDefined
();
});
done
();
})
.
catch
(()
=>
{});
});
});
});
});
spec/javascripts/sidebar/sidebar_store_spec.js
浏览文件 @
f1d48c25
import
SidebarStore
from
'
~/sidebar/stores/sidebar_store
'
;
import
SidebarStore
from
'
~/sidebar/stores/sidebar_store
'
;
import
Mock
from
'
./mock_data
'
;
import
Mock
from
'
./mock_data
'
;
import
UsersMockHelper
from
'
../
test_helpers/user_mock_data
'
;
import
UsersMockHelper
from
'
../
helpers/user_mock_data_helper
'
;
describe
(
'
Sidebar store
'
,
()
=>
{
describe
(
'
Sidebar store
'
,
()
=>
{
const
assignee
=
{
const
assignee
=
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录