mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
* Backport fix to 5.6 structure * Fix CI error, update functional test to use 5.6 visualize page objects * removed async and anon function
This commit is contained in:
parent
2933998d14
commit
a07347478b
3 changed files with 48 additions and 4 deletions
|
@ -28,8 +28,9 @@ describe('_source formatting', function () {
|
|||
}));
|
||||
|
||||
it('should use the text content type if a field is not passed', function () {
|
||||
const hit = _.first(hits);
|
||||
expect(convertHtml(hit._source)).to.be(`<span ng-non-bindable>${JSON.stringify(hit._source)}</span>`);
|
||||
const hit = { 'foo': 'bar', 'number': 42, 'hello': '<h1>World</h1>', 'also': 'with "quotes" or \'single quotes\'' };
|
||||
// eslint-disable-next-line
|
||||
expect(convertHtml(hit)).to.be('<span ng-non-bindable>{"foo":"bar","number":42,"hello":"<h1>World</h1>","also":"with \\"quotes\\" or 'single quotes'"}</span>');
|
||||
});
|
||||
|
||||
it('uses the _source, field, and hit to create a <dl>', function () {
|
||||
|
|
|
@ -19,7 +19,7 @@ export function stringifySource(Private, shortDotsFilter) {
|
|||
Source.prototype._convert = {
|
||||
text: angular.toJson,
|
||||
html: function sourceToHtml(source, field, hit) {
|
||||
if (!field) return this.getConverterFor('text')(source, field, hit);
|
||||
if (!field) return _.escape(this.getConverterFor('text')(source));
|
||||
|
||||
const highlights = (hit && hit.highlight) || {};
|
||||
const formatted = field.indexPattern.formatHit(hit);
|
||||
|
|
|
@ -84,7 +84,50 @@ export default function ({ getService, getPageObjects }) {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
it('should show correct data for a data table with top hits', function () {
|
||||
log.debug('navigateToApp visualize');
|
||||
return PageObjects.common.navigateToUrl('visualize', 'new')
|
||||
.then(function () {
|
||||
log.debug('clickDataTable');
|
||||
return PageObjects.visualize.clickDataTable();
|
||||
})
|
||||
.then(function clickNewSearch() {
|
||||
log.debug('clickNewSearch');
|
||||
return PageObjects.visualize.clickNewSearch();
|
||||
})
|
||||
.then(function setAbsoluteRange() {
|
||||
log.debug('Set absolute time range from \"' + fromTime + '\" to \"' + toTime + '\"');
|
||||
return PageObjects.header.setAbsoluteRange(fromTime, toTime);
|
||||
})
|
||||
.then(function clickMetricEditor() {
|
||||
log.debug('clickMetricEditor');
|
||||
return PageObjects.visualize.clickMetricEditor();
|
||||
})
|
||||
.then(function selectAggregation() {
|
||||
log.debug('Select aggregation');
|
||||
return PageObjects.visualize.selectAggregation('Top Hit');
|
||||
})
|
||||
.then(function selectField() {
|
||||
log.debug('Field = _source');
|
||||
return PageObjects.visualize.selectField('_source', 'metrics');
|
||||
})
|
||||
.then(function clickGo() {
|
||||
return PageObjects.visualize.clickGo();
|
||||
})
|
||||
.then(function () {
|
||||
return PageObjects.header.waitUntilLoadingHasFinished();
|
||||
})
|
||||
.then(function () {
|
||||
return retry.try(function () {
|
||||
return PageObjects.visualize.getDataTableData()
|
||||
.then(function showData(data) {
|
||||
const tableData = data.trim().split('\n');
|
||||
log.debug(tableData);
|
||||
expect(tableData.length).to.be(1);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue