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
Boxiang Sun
gitlab-ce
Commits
08a09c6b
Commit
08a09c6b
authored
Apr 17, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove IIFEs in filtered_search_bundle.js
parent
eeaeb275
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1825 additions
and
1855 deletions
+1825
-1855
app/assets/javascripts/filtered_search/dropdown_hint.js
app/assets/javascripts/filtered_search/dropdown_hint.js
+60
-62
app/assets/javascripts/filtered_search/dropdown_non_user.js
app/assets/javascripts/filtered_search/dropdown_non_user.js
+37
-39
app/assets/javascripts/filtered_search/dropdown_user.js
app/assets/javascripts/filtered_search/dropdown_user.js
+52
-54
app/assets/javascripts/filtered_search/dropdown_utils.js
app/assets/javascripts/filtered_search/dropdown_utils.js
+148
-150
app/assets/javascripts/filtered_search/filtered_search_dropdown.js
...s/javascripts/filtered_search/filtered_search_dropdown.js
+96
-98
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
...ripts/filtered_search/filtered_search_dropdown_manager.js
+148
-150
app/assets/javascripts/filtered_search/filtered_search_manager.js
...ts/javascripts/filtered_search/filtered_search_manager.js
+387
-389
app/assets/javascripts/filtered_search/filtered_search_token_keys.js
...javascripts/filtered_search/filtered_search_token_keys.js
+83
-85
app/assets/javascripts/filtered_search/filtered_search_tokenizer.js
.../javascripts/filtered_search/filtered_search_tokenizer.js
+49
-51
spec/javascripts/filtered_search/dropdown_user_spec.js
spec/javascripts/filtered_search/dropdown_user_spec.js
+46
-48
spec/javascripts/filtered_search/dropdown_utils_spec.js
spec/javascripts/filtered_search/dropdown_utils_spec.js
+222
-224
spec/javascripts/filtered_search/filtered_search_dropdown_manager_spec.js
.../filtered_search/filtered_search_dropdown_manager_spec.js
+71
-73
spec/javascripts/filtered_search/filtered_search_manager_spec.js
...vascripts/filtered_search/filtered_search_manager_spec.js
+196
-198
spec/javascripts/filtered_search/filtered_search_token_keys_spec.js
...cripts/filtered_search/filtered_search_token_keys_spec.js
+103
-105
spec/javascripts/filtered_search/filtered_search_tokenizer_spec.js
...scripts/filtered_search/filtered_search_tokenizer_spec.js
+127
-129
No files found.
app/assets/javascripts/filtered_search/dropdown_hint.js
View file @
08a09c6b
...
@@ -2,8 +2,7 @@ import Filter from '~/droplab/plugins/filter';
...
@@ -2,8 +2,7 @@ import Filter from '~/droplab/plugins/filter';
require
(
'
./filtered_search_dropdown
'
);
require
(
'
./filtered_search_dropdown
'
);
(()
=>
{
class
DropdownHint
extends
gl
.
FilteredSearchDropdown
{
class
DropdownHint
extends
gl
.
FilteredSearchDropdown
{
constructor
(
droplab
,
dropdown
,
input
,
filter
)
{
constructor
(
droplab
,
dropdown
,
input
,
filter
)
{
super
(
droplab
,
dropdown
,
input
,
filter
);
super
(
droplab
,
dropdown
,
input
,
filter
);
this
.
config
=
{
this
.
config
=
{
...
@@ -76,8 +75,7 @@ require('./filtered_search_dropdown');
...
@@ -76,8 +75,7 @@ require('./filtered_search_dropdown');
init
()
{
init
()
{
this
.
droplab
.
addHook
(
this
.
input
,
this
.
dropdown
,
[
Filter
],
this
.
config
).
init
();
this
.
droplab
.
addHook
(
this
.
input
,
this
.
dropdown
,
[
Filter
],
this
.
config
).
init
();
}
}
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
gl
.
DropdownHint
=
DropdownHint
;
gl
.
DropdownHint
=
DropdownHint
;
})();
app/assets/javascripts/filtered_search/dropdown_non_user.js
View file @
08a09c6b
...
@@ -5,8 +5,7 @@ import Filter from '~/droplab/plugins/filter';
...
@@ -5,8 +5,7 @@ import Filter from '~/droplab/plugins/filter';
require
(
'
./filtered_search_dropdown
'
);
require
(
'
./filtered_search_dropdown
'
);
(()
=>
{
class
DropdownNonUser
extends
gl
.
FilteredSearchDropdown
{
class
DropdownNonUser
extends
gl
.
FilteredSearchDropdown
{
constructor
(
droplab
,
dropdown
,
input
,
filter
,
endpoint
,
symbol
)
{
constructor
(
droplab
,
dropdown
,
input
,
filter
,
endpoint
,
symbol
)
{
super
(
droplab
,
dropdown
,
input
,
filter
);
super
(
droplab
,
dropdown
,
input
,
filter
);
this
.
symbol
=
symbol
;
this
.
symbol
=
symbol
;
...
@@ -45,8 +44,7 @@ require('./filtered_search_dropdown');
...
@@ -45,8 +44,7 @@ require('./filtered_search_dropdown');
this
.
droplab
this
.
droplab
.
addHook
(
this
.
input
,
this
.
dropdown
,
[
Ajax
,
Filter
],
this
.
config
).
init
();
.
addHook
(
this
.
input
,
this
.
dropdown
,
[
Ajax
,
Filter
],
this
.
config
).
init
();
}
}
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
gl
.
DropdownNonUser
=
DropdownNonUser
;
gl
.
DropdownNonUser
=
DropdownNonUser
;
})();
app/assets/javascripts/filtered_search/dropdown_user.js
View file @
08a09c6b
...
@@ -4,8 +4,7 @@ import AjaxFilter from '~/droplab/plugins/ajax_filter';
...
@@ -4,8 +4,7 @@ import AjaxFilter from '~/droplab/plugins/ajax_filter';
require
(
'
./filtered_search_dropdown
'
);
require
(
'
./filtered_search_dropdown
'
);
(()
=>
{
class
DropdownUser
extends
gl
.
FilteredSearchDropdown
{
class
DropdownUser
extends
gl
.
FilteredSearchDropdown
{
constructor
(
droplab
,
dropdown
,
input
,
filter
)
{
constructor
(
droplab
,
dropdown
,
input
,
filter
)
{
super
(
droplab
,
dropdown
,
input
,
filter
);
super
(
droplab
,
dropdown
,
input
,
filter
);
this
.
config
=
{
this
.
config
=
{
...
@@ -65,8 +64,7 @@ require('./filtered_search_dropdown');
...
@@ -65,8 +64,7 @@ require('./filtered_search_dropdown');
init
()
{
init
()
{
this
.
droplab
.
addHook
(
this
.
input
,
this
.
dropdown
,
[
AjaxFilter
],
this
.
config
).
init
();
this
.
droplab
.
addHook
(
this
.
input
,
this
.
dropdown
,
[
AjaxFilter
],
this
.
config
).
init
();
}
}
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
gl
.
DropdownUser
=
DropdownUser
;
gl
.
DropdownUser
=
DropdownUser
;
})();
app/assets/javascripts/filtered_search/dropdown_utils.js
View file @
08a09c6b
import
FilteredSearchContainer
from
'
./container
'
;
import
FilteredSearchContainer
from
'
./container
'
;
(()
=>
{
class
DropdownUtils
{
class
DropdownUtils
{
static
getEscapedText
(
text
)
{
static
getEscapedText
(
text
)
{
let
escapedText
=
text
;
let
escapedText
=
text
;
const
hasSpace
=
text
.
indexOf
(
'
'
)
!==
-
1
;
const
hasSpace
=
text
.
indexOf
(
'
'
)
!==
-
1
;
...
@@ -176,8 +175,7 @@ import FilteredSearchContainer from './container';
...
@@ -176,8 +175,7 @@ import FilteredSearchContainer from './container';
right
,
right
,
};
};
}
}
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
gl
.
DropdownUtils
=
DropdownUtils
;
gl
.
DropdownUtils
=
DropdownUtils
;
})();
app/assets/javascripts/filtered_search/filtered_search_dropdown.js
View file @
08a09c6b
(()
=>
{
const
DATA_DROPDOWN_TRIGGER
=
'
data-dropdown-trigger
'
;
const
DATA_DROPDOWN_TRIGGER
=
'
data-dropdown-trigger
'
;
class
FilteredSearchDropdown
{
class
FilteredSearchDropdown
{
constructor
(
droplab
,
dropdown
,
input
,
filter
)
{
constructor
(
droplab
,
dropdown
,
input
,
filter
)
{
this
.
droplab
=
droplab
;
this
.
droplab
=
droplab
;
this
.
hookId
=
input
&&
input
.
id
;
this
.
hookId
=
input
&&
input
.
id
;
...
@@ -117,8 +116,7 @@
...
@@ -117,8 +116,7 @@
hook
.
list
.
render
(
results
);
hook
.
list
.
render
(
results
);
}
}
}
}
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
gl
.
FilteredSearchDropdown
=
FilteredSearchDropdown
;
gl
.
FilteredSearchDropdown
=
FilteredSearchDropdown
;
})();
app/assets/javascripts/filtered_search/filtered_search_dropdown_manager.js
View file @
08a09c6b
import
DropLab
from
'
~/droplab/drop_lab
'
;
import
DropLab
from
'
~/droplab/drop_lab
'
;
import
FilteredSearchContainer
from
'
./container
'
;
import
FilteredSearchContainer
from
'
./container
'
;
(()
=>
{
class
FilteredSearchDropdownManager
{
class
FilteredSearchDropdownManager
{
constructor
(
baseEndpoint
=
''
,
page
)
{
constructor
(
baseEndpoint
=
''
,
page
)
{
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
baseEndpoint
=
baseEndpoint
.
replace
(
/
\/
$/
,
''
);
this
.
baseEndpoint
=
baseEndpoint
.
replace
(
/
\/
$/
,
''
);
...
@@ -184,8 +183,7 @@ import FilteredSearchContainer from './container';
...
@@ -184,8 +183,7 @@ import FilteredSearchContainer from './container';
destroyDroplab
()
{
destroyDroplab
()
{
this
.
droplab
.
destroy
();
this
.
droplab
.
destroy
();
}
}
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
gl
.
FilteredSearchDropdownManager
=
FilteredSearchDropdownManager
;
gl
.
FilteredSearchDropdownManager
=
FilteredSearchDropdownManager
;
})();
app/assets/javascripts/filtered_search/filtered_search_manager.js
View file @
08a09c6b
...
@@ -6,8 +6,7 @@ import RecentSearchesStore from './stores/recent_searches_store';
...
@@ -6,8 +6,7 @@ import RecentSearchesStore from './stores/recent_searches_store';
import
RecentSearchesService
from
'
./services/recent_searches_service
'
;
import
RecentSearchesService
from
'
./services/recent_searches_service
'
;
import
eventHub
from
'
./event_hub
'
;
import
eventHub
from
'
./event_hub
'
;
(()
=>
{
class
FilteredSearchManager
{
class
FilteredSearchManager
{
constructor
(
page
)
{
constructor
(
page
)
{
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
container
=
FilteredSearchContainer
.
container
;
this
.
filteredSearchInput
=
this
.
container
.
querySelector
(
'
.filtered-search
'
);
this
.
filteredSearchInput
=
this
.
container
.
querySelector
(
'
.filtered-search
'
);
...
@@ -487,8 +486,7 @@ import eventHub from './event_hub';
...
@@ -487,8 +486,7 @@ import eventHub from './event_hub';
this
.
filteredSearchInput
.
dispatchEvent
(
new
CustomEvent
(
'
input
'
));
this
.
filteredSearchInput
.
dispatchEvent
(
new
CustomEvent
(
'
input
'
));
this
.
search
();
this
.
search
();
}
}
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
gl
.
FilteredSearchManager
=
FilteredSearchManager
;
gl
.
FilteredSearchManager
=
FilteredSearchManager
;
})();
app/assets/javascripts/filtered_search/filtered_search_token_keys.js
View file @
08a09c6b
(()
=>
{
const
tokenKeys
=
[{
const
tokenKeys
=
[{
key
:
'
author
'
,
key
:
'
author
'
,
type
:
'
string
'
,
type
:
'
string
'
,
param
:
'
username
'
,
param
:
'
username
'
,
symbol
:
'
@
'
,
symbol
:
'
@
'
,
},
{
},
{
key
:
'
assignee
'
,
key
:
'
assignee
'
,
type
:
'
string
'
,
type
:
'
string
'
,
param
:
'
username
'
,
param
:
'
username
'
,
symbol
:
'
@
'
,
symbol
:
'
@
'
,
},
{
},
{
key
:
'
milestone
'
,
key
:
'
milestone
'
,
type
:
'
string
'
,
type
:
'
string
'
,
param
:
'
title
'
,
param
:
'
title
'
,
symbol
:
'
%
'
,
symbol
:
'
%
'
,
},
{
},
{
key
:
'
label
'
,
key
:
'
label
'
,
type
:
'
array
'
,
type
:
'
array
'
,
param
:
'
name[]
'
,
param
:
'
name[]
'
,
symbol
:
'
~
'
,
symbol
:
'
~
'
,
}];
}];
const
alternativeTokenKeys
=
[{
const
alternativeTokenKeys
=
[{
key
:
'
label
'
,
key
:
'
label
'
,
type
:
'
string
'
,
type
:
'
string
'
,
param
:
'
name
'
,
param
:
'
name
'
,
symbol
:
'
~
'
,
symbol
:
'
~
'
,
}];
}];
const
tokenKeysWithAlternative
=
tokenKeys
.
concat
(
alternativeTokenKeys
);
const
tokenKeysWithAlternative
=
tokenKeys
.
concat
(
alternativeTokenKeys
);
const
conditions
=
[{
const
conditions
=
[{
url
:
'
assignee_id=0
'
,
url
:
'
assignee_id=0
'
,
tokenKey
:
'
assignee
'
,
tokenKey
:
'
assignee
'
,
value
:
'
none
'
,
value
:
'
none
'
,
},
{
},
{
url
:
'
milestone_title=No+Milestone
'
,
url
:
'
milestone_title=No+Milestone
'
,
tokenKey
:
'
milestone
'
,
tokenKey
:
'
milestone
'
,
value
:
'
none
'
,
value
:
'
none
'
,
},
{
},
{
url
:
'
milestone_title=%23upcoming
'
,
url
:
'
milestone_title=%23upcoming
'
,
tokenKey
:
'
milestone
'
,
tokenKey
:
'
milestone
'
,
value
:
'
upcoming
'
,
value
:
'
upcoming
'
,
},
{
},
{
url
:
'
milestone_title=%23started
'
,
url
:
'
milestone_title=%23started
'
,
tokenKey
:
'
milestone
'
,
tokenKey
:
'
milestone
'
,
value
:
'
started
'
,
value
:
'
started
'
,
},
{
},
{
url
:
'
label_name[]=No+Label
'
,
url
:
'
label_name[]=No+Label
'
,
tokenKey
:
'
label
'
,
tokenKey
:
'
label
'
,
value
:
'
none
'
,
value
:
'
none
'
,
}];
}];
class
FilteredSearchTokenKeys
{
class
FilteredSearchTokenKeys
{
static
get
()
{
static
get
()
{
return
tokenKeys
;
return
tokenKeys
;
}
}
...
@@ -93,8 +92,7 @@
...
@@ -93,8 +92,7 @@
return
conditions
return
conditions
.
find
(
condition
=>
condition
.
tokenKey
===
key
&&
condition
.
value
===
value
)
||
null
;
.
find
(
condition
=>
condition
.
tokenKey
===
key
&&
condition
.
value
===
value
)
||
null
;
}
}
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
gl
.
FilteredSearchTokenKeys
=
FilteredSearchTokenKeys
;
gl
.
FilteredSearchTokenKeys
=
FilteredSearchTokenKeys
;
})();
app/assets/javascripts/filtered_search/filtered_search_tokenizer.js
View file @
08a09c6b
require
(
'
./filtered_search_token_keys
'
);
require
(
'
./filtered_search_token_keys
'
);
(()
=>
{
class
FilteredSearchTokenizer
{
class
FilteredSearchTokenizer
{
static
processTokens
(
input
)
{
static
processTokens
(
input
)
{
const
allowedKeys
=
gl
.
FilteredSearchTokenKeys
.
get
().
map
(
i
=>
i
.
key
);
const
allowedKeys
=
gl
.
FilteredSearchTokenKeys
.
get
().
map
(
i
=>
i
.
key
);
// Regex extracts `(token):(symbol)(value)`
// Regex extracts `(token):(symbol)(value)`
...
@@ -51,8 +50,7 @@ require('./filtered_search_token_keys');
...
@@ -51,8 +50,7 @@ require('./filtered_search_token_keys');
searchToken
,
searchToken
,
};
};
}
}
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
=
window
.
gl
||
{};
gl
.
FilteredSearchTokenizer
=
FilteredSearchTokenizer
;
gl
.
FilteredSearchTokenizer
=
FilteredSearchTokenizer
;
})();
spec/javascripts/filtered_search/dropdown_user_spec.js
View file @
08a09c6b
...
@@ -3,8 +3,7 @@ require('~/filtered_search/filtered_search_tokenizer');
...
@@ -3,8 +3,7 @@ require('~/filtered_search/filtered_search_tokenizer');
require
(
'
~/filtered_search/filtered_search_dropdown
'
);
require
(
'
~/filtered_search/filtered_search_dropdown
'
);
require
(
'
~/filtered_search/dropdown_user
'
);
require
(
'
~/filtered_search/dropdown_user
'
);
(()
=>
{
describe
(
'
Dropdown User
'
,
()
=>
{
describe
(
'
Dropdown User
'
,
()
=>
{
describe
(
'
getSearchInput
'
,
()
=>
{
describe
(
'
getSearchInput
'
,
()
=>
{
let
dropdownUser
;
let
dropdownUser
;
...
@@ -67,5 +66,4 @@ require('~/filtered_search/dropdown_user');
...
@@ -67,5 +66,4 @@ require('~/filtered_search/dropdown_user');
window
.
gon
=
{};
window
.
gon
=
{};
});
});
});
});
});
});
})();
spec/javascripts/filtered_search/dropdown_utils_spec.js
View file @
08a09c6b
...
@@ -3,8 +3,7 @@ require('~/filtered_search/dropdown_utils');
...
@@ -3,8 +3,7 @@ require('~/filtered_search/dropdown_utils');
require
(
'
~/filtered_search/filtered_search_tokenizer
'
);
require
(
'
~/filtered_search/filtered_search_tokenizer
'
);
require
(
'
~/filtered_search/filtered_search_dropdown_manager
'
);
require
(
'
~/filtered_search/filtered_search_dropdown_manager
'
);
(()
=>
{
describe
(
'
Dropdown Utils
'
,
()
=>
{
describe
(
'
Dropdown Utils
'
,
()
=>
{
describe
(
'
getEscapedText
'
,
()
=>
{
describe
(
'
getEscapedText
'
,
()
=>
{
it
(
'
should return same word when it has no space
'
,
()
=>
{
it
(
'
should return same word when it has no space
'
,
()
=>
{
const
escaped
=
gl
.
DropdownUtils
.
getEscapedText
(
'
textWithoutSpace
'
);
const
escaped
=
gl
.
DropdownUtils
.
getEscapedText
(
'
textWithoutSpace
'
);
...
@@ -306,5 +305,4 @@ require('~/filtered_search/filtered_search_dropdown_manager');
...
@@ -306,5 +305,4 @@ require('~/filtered_search/filtered_search_dropdown_manager');
});
});
});
});
});
});
});
});
})();
spec/javascripts/filtered_search/filtered_search_dropdown_manager_spec.js
View file @
08a09c6b
...
@@ -3,8 +3,7 @@ require('~/filtered_search/filtered_search_visual_tokens');
...
@@ -3,8 +3,7 @@ require('~/filtered_search/filtered_search_visual_tokens');
require
(
'
~/filtered_search/filtered_search_tokenizer
'
);
require
(
'
~/filtered_search/filtered_search_tokenizer
'
);
require
(
'
~/filtered_search/filtered_search_dropdown_manager
'
);
require
(
'
~/filtered_search/filtered_search_dropdown_manager
'
);
(()
=>
{
describe
(
'
Filtered Search Dropdown Manager
'
,
()
=>
{
describe
(
'
Filtered Search Dropdown Manager
'
,
()
=>
{
describe
(
'
addWordToInput
'
,
()
=>
{
describe
(
'
addWordToInput
'
,
()
=>
{
function
getInputValue
()
{
function
getInputValue
()
{
return
document
.
querySelector
(
'
.filtered-search
'
).
value
;
return
document
.
querySelector
(
'
.filtered-search
'
).
value
;
...
@@ -97,5 +96,4 @@ require('~/filtered_search/filtered_search_dropdown_manager');
...
@@ -97,5 +96,4 @@ require('~/filtered_search/filtered_search_dropdown_manager');
});
});
});
});
});
});
});
});
})();
spec/javascripts/filtered_search/filtered_search_manager_spec.js
View file @
08a09c6b
...
@@ -6,8 +6,7 @@ require('~/filtered_search/filtered_search_dropdown_manager');
...
@@ -6,8 +6,7 @@ require('~/filtered_search/filtered_search_dropdown_manager');
require
(
'
~/filtered_search/filtered_search_manager
'
);
require
(
'
~/filtered_search/filtered_search_manager
'
);
const
FilteredSearchSpecHelper
=
require
(
'
../helpers/filtered_search_spec_helper
'
);
const
FilteredSearchSpecHelper
=
require
(
'
../helpers/filtered_search_spec_helper
'
);
(()
=>
{
describe
(
'
Filtered Search Manager
'
,
()
=>
{
describe
(
'
Filtered Search Manager
'
,
()
=>
{
let
input
;
let
input
;
let
manager
;
let
manager
;
let
tokensContainer
;
let
tokensContainer
;
...
@@ -272,5 +271,4 @@ const FilteredSearchSpecHelper = require('../helpers/filtered_search_spec_helper
...
@@ -272,5 +271,4 @@ const FilteredSearchSpecHelper = require('../helpers/filtered_search_spec_helper
expect
(
document
.
querySelector
(
'
.filtered-search-box
'
).
classList
.
contains
(
'
focus
'
)).
toEqual
(
false
);
expect
(
document
.
querySelector
(
'
.filtered-search-box
'
).
classList
.
contains
(
'
focus
'
)).
toEqual
(
false
);
});
});
});
});
});
});
})();
spec/javascripts/filtered_search/filtered_search_token_keys_spec.js
View file @
08a09c6b
require
(
'
~/extensions/array
'
);
require
(
'
~/extensions/array
'
);
require
(
'
~/filtered_search/filtered_search_token_keys
'
);
require
(
'
~/filtered_search/filtered_search_token_keys
'
);
(()
=>
{
describe
(
'
Filtered Search Token Keys
'
,
()
=>
{
describe
(
'
Filtered Search Token Keys
'
,
()
=>
{
describe
(
'
get
'
,
()
=>
{
describe
(
'
get
'
,
()
=>
{
let
tokenKeys
;
let
tokenKeys
;
...
@@ -106,5 +105,4 @@ require('~/filtered_search/filtered_search_token_keys');
...
@@ -106,5 +105,4 @@ require('~/filtered_search/filtered_search_token_keys');
expect
(
result
).
toEqual
(
conditions
[
0
]);
expect
(
result
).
toEqual
(
conditions
[
0
]);
});
});
});
});
});
});
})();
spec/javascripts/filtered_search/filtered_search_tokenizer_spec.js
View file @
08a09c6b
...
@@ -2,8 +2,7 @@ require('~/extensions/array');
...
@@ -2,8 +2,7 @@ require('~/extensions/array');
require
(
'
~/filtered_search/filtered_search_token_keys
'
);
require
(
'
~/filtered_search/filtered_search_token_keys
'
);
require
(
'
~/filtered_search/filtered_search_tokenizer
'
);
require
(
'
~/filtered_search/filtered_search_tokenizer
'
);
(()
=>
{
describe
(
'
Filtered Search Tokenizer
'
,
()
=>
{
describe
(
'
Filtered Search Tokenizer
'
,
()
=>
{
describe
(
'
processTokens
'
,
()
=>
{
describe
(
'
processTokens
'
,
()
=>
{
it
(
'
returns for input containing only search value
'
,
()
=>
{
it
(
'
returns for input containing only search value
'
,
()
=>
{
const
results
=
gl
.
FilteredSearchTokenizer
.
processTokens
(
'
searchTerm
'
);
const
results
=
gl
.
FilteredSearchTokenizer
.
processTokens
(
'
searchTerm
'
);
...
@@ -131,5 +130,4 @@ require('~/filtered_search/filtered_search_tokenizer');
...
@@ -131,5 +130,4 @@ require('~/filtered_search/filtered_search_tokenizer');
expect
(
results
.
tokens
[
0
].
symbol
).
toBe
(
'
~
'
);
expect
(
results
.
tokens
[
0
].
symbol
).
toBe
(
'
~
'
);
});
});
});
});
});
});
})();
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