Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
12753def
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,发现更多精彩内容 >>
提交
12753def
编写于
12月 18, 2016
作者:
C
Clement Ho
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix specs
上级
f72c1bf1
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
36 addition
and
62 deletion
+36
-62
app/assets/javascripts/dispatcher.js.es6
app/assets/javascripts/dispatcher.js.es6
+1
-1
app/assets/javascripts/filtered_search/dropdown_utils.js.es6
app/assets/javascripts/filtered_search/dropdown_utils.js.es6
+1
-1
spec/features/issues/filtered_search/dropdown_author_spec.rb
spec/features/issues/filtered_search/dropdown_author_spec.rb
+4
-9
spec/features/issues/filtered_search/dropdown_label_spec.rb
spec/features/issues/filtered_search/dropdown_label_spec.rb
+23
-17
spec/features/issues/filtered_search/dropdown_milestone_spec.rb
...eatures/issues/filtered_search/dropdown_milestone_spec.rb
+7
-32
spec/javascripts/filtered_search/filtered_search_dropdown_manager_spec.js.es6
...tered_search/filtered_search_dropdown_manager_spec.js.es6
+0
-2
未找到文件。
app/assets/javascripts/dispatcher.js.es6
浏览文件 @
12753def
...
...
@@ -84,7 +84,7 @@
break;
case 'projects:merge_requests:index':
case 'projects:issues:index':
if(document.querySelector('.filtered-search') && gl.FilteredSearchManager) {
if
(document.querySelector('.filtered-search') && gl.FilteredSearchManager) {
new gl.FilteredSearchManager();
}
Issuable.init();
...
...
app/assets/javascripts/filtered_search/dropdown_utils.js.es6
浏览文件 @
12753def
...
...
@@ -43,7 +43,7 @@
static filterHint(item, query) {
const updatedItem = item;
let { lastToken } = gl.FilteredSearchTokenizer.processTokens(query);
lastToken = lastToken || '';
lastToken = lastToken
.key || lastToken
|| '';
if (!lastToken || query.split('').last() === ' ') {
updatedItem.droplab_hidden = false;
...
...
spec/features/issues/filtered_search/dropdown_author_spec.rb
浏览文件 @
12753def
...
...
@@ -70,13 +70,13 @@ describe 'Dropdown author', js: true, feature: true do
end
it
'filters by name'
do
send_keys_to_filtered_search
(
'j'
)
expect
(
dropdown_author_size
).
to
eq
(
2
)
send_keys_to_filtered_search
(
'j
a
'
)
expect
(
dropdown_author_size
).
to
eq
(
1
)
end
it
'filters by case insensitive name'
do
send_keys_to_filtered_search
(
'J'
)
expect
(
dropdown_author_size
).
to
eq
(
2
)
send_keys_to_filtered_search
(
'J
a
'
)
expect
(
dropdown_author_size
).
to
eq
(
1
)
end
it
'filters by username with symbol'
do
...
...
@@ -84,11 +84,6 @@ describe 'Dropdown author', js: true, feature: true do
expect
(
dropdown_author_size
).
to
eq
(
2
)
end
it
'filters by case insensitive username with symbol'
do
send_keys_to_filtered_search
(
'@OT'
)
expect
(
dropdown_author_size
).
to
eq
(
2
)
end
it
'filters by username without symbol'
do
send_keys_to_filtered_search
(
'ot'
)
expect
(
dropdown_author_size
).
to
eq
(
2
)
...
...
spec/features/issues/filtered_search/dropdown_label_spec.rb
浏览文件 @
12753def
...
...
@@ -9,6 +9,7 @@ describe 'Dropdown label', js: true, feature: true do
let!
(
:uppercase_label
)
{
create
(
:label
,
project:
project
,
title:
'BUG'
)
}
let!
(
:two_words_label
)
{
create
(
:label
,
project:
project
,
title:
'High Priority'
)
}
let!
(
:wont_fix_label
)
{
create
(
:label
,
project:
project
,
title:
'Won"t Fix'
)
}
let!
(
:wont_fix_single_label
)
{
create
(
:label
,
project:
project
,
title:
'Won\'t Fix'
)
}
let!
(
:special_label
)
{
create
(
:label
,
project:
project
,
title:
'!@#$%^+&*()'
)}
let!
(
:long_label
)
{
create
(
:label
,
project:
project
,
title:
'this is a very long title this is a very long title this is a very long title this is a very long title this is a very long title'
)}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
...
...
@@ -68,61 +69,66 @@ describe 'Dropdown label', js: true, feature: true do
describe
'filtering'
do
before
do
filtered_search
.
set
(
'label
:
'
)
filtered_search
.
set
(
'label'
)
end
it
'filters by name'
do
send_keys_to_filtered_search
(
'b'
)
send_keys_to_filtered_search
(
'
:
b'
)
expect
(
dropdown_label_size
).
to
eq
(
2
)
end
it
'filters by case insensitive name'
do
send_keys_to_filtered_search
(
'B'
)
send_keys_to_filtered_search
(
'
:
B'
)
expect
(
dropdown_label_size
).
to
eq
(
2
)
end
it
'filters by name with symbol'
do
send_keys_to_filtered_search
(
'~bu'
)
send_keys_to_filtered_search
(
'
:
~bu'
)
expect
(
dropdown_label_size
).
to
eq
(
2
)
end
it
'filters by case insensitive name with symbol'
do
send_keys_to_filtered_search
(
'~BU'
)
send_keys_to_filtered_search
(
'
:
~BU'
)
expect
(
dropdown_label_size
).
to
eq
(
2
)
end
it
'filters by multiple names using double quotes'
do
send_keys_to_filtered_search
(
'"High P'
)
it
'filters by multiple words'
do
send_keys_to_filtered_search
(
':Hig'
)
expect
(
dropdown_label_size
).
to
eq
(
1
)
end
it
'filters by multiple words with symbol'
do
send_keys_to_filtered_search
(
':~Hig'
)
expect
(
dropdown_label_size
).
to
eq
(
1
)
end
it
'filters by multiple
names us
ing single quotes'
do
send_keys_to_filtered_search
(
'
\'High P
'
)
it
'filters by multiple
words contain
ing single quotes'
do
send_keys_to_filtered_search
(
'
:won\'t
'
)
expect
(
dropdown_label_size
).
to
eq
(
1
)
end
it
'filters by multiple
names using single and double quotes
'
do
send_keys_to_filtered_search
(
'
~"won`\'t f
'
)
it
'filters by multiple
words containing single quotes with symbol
'
do
send_keys_to_filtered_search
(
'
:~won\'t
'
)
expect
(
dropdown_label_size
).
to
eq
(
1
)
end
it
'filters by multiple
names using double quotes with symbol
'
do
send_keys_to_filtered_search
(
'
~"High P
'
)
it
'filters by multiple
words containing double quotes
'
do
send_keys_to_filtered_search
(
'
:won"t
'
)
expect
(
dropdown_label_size
).
to
eq
(
1
)
end
it
'filters by multiple
names using sing
le quotes with symbol'
do
send_keys_to_filtered_search
(
'
~\'High P
'
)
it
'filters by multiple
words containing doub
le quotes with symbol'
do
send_keys_to_filtered_search
(
'
:~won"t
'
)
expect
(
dropdown_label_size
).
to
eq
(
1
)
end
it
'filters by special characters'
do
send_keys_to_filtered_search
(
'^+'
)
send_keys_to_filtered_search
(
'
:
^+'
)
expect
(
dropdown_label_size
).
to
eq
(
1
)
end
it
'filters by special characters with symbol'
do
send_keys_to_filtered_search
(
'~^+'
)
send_keys_to_filtered_search
(
'
:
~^+'
)
expect
(
dropdown_label_size
).
to
eq
(
1
)
end
end
...
...
spec/features/issues/filtered_search/dropdown_milestone_spec.rb
浏览文件 @
12753def
...
...
@@ -73,61 +73,36 @@ describe 'Dropdown milestone', js: true, feature: true do
describe
'filtering'
do
before
do
filtered_search
.
set
(
'milestone
:
'
)
filtered_search
.
set
(
'milestone'
)
end
it
'filters by name'
do
send_keys_to_filtered_search
(
'v1'
)
send_keys_to_filtered_search
(
'
:
v1'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
end
it
'filters by case insensitive name'
do
send_keys_to_filtered_search
(
'V1'
)
send_keys_to_filtered_search
(
'
:
V1'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
end
it
'filters by name with symbol'
do
send_keys_to_filtered_search
(
'%v1'
)
send_keys_to_filtered_search
(
'
:
%v1'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
end
it
'filters by case insensitive name with symbol'
do
send_keys_to_filtered_search
(
'%V1'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
end
it
'filters by multiple names using double quotes'
do
send_keys_to_filtered_search
(
'"future'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
end
it
'filters by multiple names using single quotes'
do
send_keys_to_filtered_search
(
'\'future p'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
end
it
'filters by multiple names using single and double quotes'
do
send_keys_to_filtered_search
(
'%"won`\'t f'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
end
it
'filters by multiple names using double quotes with symbol'
do
send_keys_to_filtered_search
(
'%"future p'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
end
it
'filters by multiple names using single quotes with symbol'
do
send_keys_to_filtered_search
(
'%\'future p'
)
send_keys_to_filtered_search
(
':%V1'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
end
it
'filters by special characters'
do
send_keys_to_filtered_search
(
'
^
+'
)
send_keys_to_filtered_search
(
'
:(
+'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
end
it
'filters by special characters with symbol'
do
send_keys_to_filtered_search
(
'
~^
+'
)
send_keys_to_filtered_search
(
'
:%(
+'
)
expect
(
dropdown_milestone_size
).
to
eq
(
1
)
end
end
...
...
spec/javascripts/filtered_search/filtered_search_dropdown_manager_spec.js.es6
浏览文件 @
12753def
...
...
@@ -12,8 +12,6 @@
const input = document.createElement('input');
input.classList.add('filtered-search');
document.body.appendChild(input);
expect(input.value).toBe('');
});
afterEach(() => {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录