Skip to content

Commit

Permalink
- added analyze_wildcard to query body
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Jul 18, 2016
1 parent 721d3bc commit a484283
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ app.service('savedVisualizations', function (Promise, es, kbnIndex, SavedVis, Pr
body = {
query: {
simple_query_string: {
query: searchString + (['/', '!', '?', '&', '=', '%'].indexOf(searchString[searchString.length - 1]) === -1 ? '' : ' ') + '*',
query: searchString + '*',
fields: ['title^3', 'description'],
default_operator: 'AND'
default_operator: 'AND',
analyze_wildcard: true
}
}
};
Expand Down
29 changes: 7 additions & 22 deletions test/functional/apps/visualize/_area_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,28 +63,13 @@ bdd.describe('visualize app', function describeIndexTests() {
var vizName1 = 'Visualization AreaChart';

bdd.it('should save and load with special characters', function pageHeader() {
let vizName2 = vizName1 + '/?&=%';
return PageObjects.visualize.saveVisualization(vizName2)
.then(function (message) {
PageObjects.common.debug('Saved viz message = ' + message);
PageObjects.common.saveScreenshot('Visualize-area-chart-save-toast');
expect(message).to.be('Visualization Editor: Saved Visualization \"' + vizName2 + '\"');
})
.then(function testVisualizeWaitForToastMessageGone() {
return PageObjects.visualize.waitForToastMessageGone();
})
.then(function loadSavedVisualization() {
return PageObjects.visualize.loadSavedVisualization(vizName2);
})
.then(function () {
return PageObjects.visualize.waitForVisualization();
})
// We have to sleep sometime between loading the saved visTitle
// and trying to access the chart below with getXAxisLabels
// otherwise it hangs.
.then(function sleep() {
return PageObjects.common.sleep(2000);
});
const vizNamewithSpecialChars = vizName1 + '/?&=%';
return PageObjects.visualize.saveVisualization(vizNamewithSpecialChars)
.then(function (message) {
PageObjects.common.debug(`Saved viz message = ${message}`);
PageObjects.common.saveScreenshot('Visualize-area-chart-save-toast');
expect(message).to.be(`Visualization Editor: Saved Visualization "${vizNamewithSpecialChars}"`);
});
});

bdd.it('should save and load', function pageHeader() {
Expand Down

0 comments on commit a484283

Please sign in to comment.