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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
a7e0f810
Commit
a7e0f810
authored
May 23, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for getKeys()
parent
f9d32b3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
spec/javascripts/filtered_search/filtered_search_token_keys_spec.js
...cripts/filtered_search/filtered_search_token_keys_spec.js
+11
-0
spec/javascripts/filtered_search/filtered_search_token_keys_with_weights_spec.js
...ed_search/filtered_search_token_keys_with_weights_spec.js
+17
-0
No files found.
spec/javascripts/filtered_search/filtered_search_token_keys_spec.js
View file @
a7e0f810
...
...
@@ -18,6 +18,17 @@ describe('Filtered Search Token Keys', () => {
});
});
describe
(
'
getKeys
'
,
()
=>
{
it
(
'
should return keys
'
,
()
=>
{
const
getKeys
=
gl
.
FilteredSearchTokenKeys
.
getKeys
();
const
keys
=
gl
.
FilteredSearchTokenKeys
.
get
().
map
(
i
=>
i
.
key
);
keys
.
forEach
((
key
,
i
)
=>
{
expect
(
key
).
toEqual
(
getKeys
[
i
]);
});
});
});
describe
(
'
getConditions
'
,
()
=>
{
let
conditions
;
...
...
spec/javascripts/filtered_search/filtered_search_token_keys_with_weights_spec.js
View file @
a7e0f810
...
...
@@ -30,6 +30,23 @@ require('~/filtered_search/filtered_search_token_keys_with_weights');
const
match
=
tokenKeys
.
find
(
tk
=>
tk
.
key
===
weightTokenKey
.
key
);
expect
(
match
).
toEqual
(
weightTokenKey
);
});
it
(
'
should always return the same array
'
,
()
=>
{
const
tokenKeys2
=
gl
.
FilteredSearchTokenKeysWithWeights
.
get
();
expect
(
tokenKeys
).
toEqual
(
tokenKeys2
);
});
});
describe
(
'
getKeys
'
,
()
=>
{
it
(
'
should return keys
'
,
()
=>
{
const
getKeys
=
gl
.
FilteredSearchTokenKeysWithWeights
.
getKeys
();
const
keys
=
gl
.
FilteredSearchTokenKeysWithWeights
.
get
().
map
(
i
=>
i
.
key
);
keys
.
forEach
((
key
,
i
)
=>
{
expect
(
key
).
toEqual
(
getKeys
[
i
]);
});
});
});
describe
(
'
getConditions
'
,
()
=>
{
...
...
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