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
0f973c28
Commit
0f973c28
authored
Jan 06, 2017
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs
parent
d5dee97b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
6 deletions
+14
-6
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
...avascripts/filtered_search/filtered_search_manager.js.es6
+8
-1
spec/javascripts/filtered_search/dropdown_utils_spec.js.es6
spec/javascripts/filtered_search/dropdown_utils_spec.js.es6
+4
-3
spec/javascripts/filtered_search/filtered_search_tokenizer_spec.js.es6
...pts/filtered_search/filtered_search_tokenizer_spec.js.es6
+2
-2
No files found.
app/assets/javascripts/filtered_search/filtered_search_manager.js.es6
View file @
0f973c28
...
...
@@ -142,7 +142,14 @@
if (condition) {
tokenPath = condition.url;
} else {
tokenPath = `${keyParam}=${encodeURIComponent(token.value)}`;
let tokenValue = token.value;
if ((tokenValue[0] === '\'' && tokenValue[tokenValue.length - 1] === '\'') ||
(tokenValue[0] === '"' && tokenValue[tokenValue.length - 1] === '"')) {
tokenValue = tokenValue.slice(1, tokenValue.length - 1);
}
tokenPath = `${keyParam}=${encodeURIComponent(tokenValue)}`;
}
paths.push(tokenPath);
...
...
spec/javascripts/filtered_search/dropdown_utils_spec.js.es6
View file @
0f973c28
//= require extensions/array
//= require filtered_search/dropdown_utils
//= require filtered_search/filtered_search_tokenizer
//= require filtered_search/filtered_search_dropdown_manager
...
...
@@ -80,7 +81,7 @@
getAttribute: () => 'value',
};
gl.DropdownUtils.setDataValueIfSelected(selected);
gl.DropdownUtils.setDataValueIfSelected(
null,
selected);
expect(gl.FilteredSearchDropdownManager.addWordToInput.calls.count()).toEqual(1);
});
...
...
@@ -89,7 +90,7 @@
getAttribute: () => 'value',
};
const result = gl.DropdownUtils.setDataValueIfSelected(selected);
const result = gl.DropdownUtils.setDataValueIfSelected(
null,
selected);
expect(result).toBe(true);
});
...
...
@@ -98,7 +99,7 @@
getAttribute: () => null,
};
const result = gl.DropdownUtils.setDataValueIfSelected(selected);
const result = gl.DropdownUtils.setDataValueIfSelected(
null,
selected);
expect(result).toBe(false);
});
});
...
...
spec/javascripts/filtered_search/filtered_search_tokenizer_spec.js.es6
View file @
0f973c28
...
...
@@ -24,7 +24,7 @@
expect(results.tokens[0].symbol).toBe('@');
expect(results.tokens[1].key).toBe('label');
expect(results.tokens[1].value).toBe('
Very Important
');
expect(results.tokens[1].value).toBe('
"Very Important"
');
expect(results.tokens[1].symbol).toBe('~');
expect(results.tokens[2].key).toBe('milestone');
...
...
@@ -72,7 +72,7 @@
expect(results.tokens[0].symbol).toBe('@');
expect(results.tokens[1].key).toBe('label');
expect(results.tokens[1].value).toBe('
Won\'t fix
');
expect(results.tokens[1].value).toBe('
"Won\'t fix"
');
expect(results.tokens[1].symbol).toBe('~');
expect(results.tokens[2].key).toBe('milestone');
...
...
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