1
0
Fork 0

chore(lint): Make the js linter happy

This commit is contained in:
Pixelastic 2016-01-20 15:52:38 +01:00
parent 9752f14527
commit 7135ccc140
4 changed files with 21 additions and 4 deletions

View file

@ -60,7 +60,10 @@ class DocSearch {
footer: templates.footer
}
}]);
this.autocomplete.on('autocomplete:selected', this.handleSelected.bind(null, this.autocomplete.autocomplete));
this.autocomplete.on(
'autocomplete:selected',
this.handleSelected.bind(null, this.autocomplete.autocomplete)
);
}
/**

View file

@ -10,7 +10,9 @@ let templates = {
">
<div class="${suggestionPrefix}--category-header">{{{category}}}</div>
<div class="${suggestionPrefix}--wrapper">
<div class="${suggestionPrefix}--subcategory-column"><span class="${suggestionPrefix}--subcategory-column-text">{{{subcategory}}}</span></div>
<div class="${suggestionPrefix}--subcategory-column">
<span class="${suggestionPrefix}--subcategory-column-text">{{{subcategory}}}</span>
</div>
<div class="${suggestionPrefix}--content">
<div class="${suggestionPrefix}--subcategory-inline">{{{subcategory}}}</div>
<div class="${suggestionPrefix}--title">{{{title}}}</div>

View file

@ -685,7 +685,11 @@ describe('DocSearch', () => {
let actual = DocSearch.formatHits(input);
// Then
expect(actual[0].title).toEqual('<mark>Geo-search</mark> <mark>Foo</mark> <mark>Bar</mark> <mark>Baz</mark>');
let expected = '<mark>Geo-search</mark>' +
' <mark>Foo</mark>' +
' <mark>Bar</mark>' +
' <mark>Baz</mark>';
expect(actual[0].title).toEqual(expected);
});
it('should add ellipsis to content', () => {
// Given

View file

@ -5,7 +5,15 @@ global.iit = it.only;
global.xit = it.skip;
/**
* Wait for max `escapeTime` ms and run `runFunction` except if `escapeFunction` returned true
* Runs `runFunction` only when `escapeFunction` returns true. Timeout after
* `escapeTime`ms.
* @function waitForAndRun
* @param {function} escapeFunction Function to wait for. Once it returns
* `true`, we execute `runFunction`
* @param {function} runFunction Function to run once `escapeFunction` returns
* `true.
* @param {number} escapeTime Time (in ms) after which we timeout.
* @returns {void}
*/
function waitForAndRun(escapeFunction, runFunction, escapeTime) {
// check the escapeFunction every millisecond so as soon as it is met we can escape the function