mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
parent
71b24c7f2a
commit
64275710ff
1 changed files with 24 additions and 0 deletions
|
@ -101,5 +101,29 @@ describe('AggConfigResult', function () {
|
|||
expect(filter.query.match.extension).to.have.property('type', 'phrase');
|
||||
});
|
||||
});
|
||||
|
||||
describe('toString', function () {
|
||||
it('should provide a parsedUrl to the field formatter', function () {
|
||||
const vis = new Vis(indexPattern, {
|
||||
type: 'histogram',
|
||||
aggs: [
|
||||
{ type: 'terms', schema: 'segment', params: { field: 'extension' } }
|
||||
]
|
||||
});
|
||||
|
||||
const aggConfig = vis.aggs.byTypeName.terms[0];
|
||||
aggConfig.fieldFormatter = () => {
|
||||
return (value, second, third, parsedUrl) => {
|
||||
return parsedUrl;
|
||||
};
|
||||
};
|
||||
const result = new AggConfigResult(aggConfig, null, '../app/kibana/#visualize', 'php');
|
||||
const parsedUrl = result.toString('html');
|
||||
const keys = Object.keys(parsedUrl);
|
||||
expect(keys[0]).to.be('origin');
|
||||
expect(keys[1]).to.be('pathname');
|
||||
expect(keys[2]).to.be('basePath');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue