|
|
|
|
@ -888,7 +888,6 @@ describe('ElasticQueryBuilder', () => { |
|
|
|
|
|
|
|
|
|
describe('field property', () => { |
|
|
|
|
it('should use timeField from datasource when not specified', () => { |
|
|
|
|
const expectedTimezone = 'America/Los_angeles'; |
|
|
|
|
const query = builder.build({ |
|
|
|
|
refId: 'A', |
|
|
|
|
metrics: [{ type: 'count', id: '1' }], |
|
|
|
|
@ -897,7 +896,7 @@ describe('ElasticQueryBuilder', () => { |
|
|
|
|
{ |
|
|
|
|
type: 'date_histogram', |
|
|
|
|
id: '2', |
|
|
|
|
settings: { min_doc_count: '1', timeZone: expectedTimezone }, |
|
|
|
|
settings: { min_doc_count: '1' }, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}); |
|
|
|
|
@ -906,7 +905,6 @@ describe('ElasticQueryBuilder', () => { |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('should use field from bucket agg when specified', () => { |
|
|
|
|
const expectedTimezone = 'America/Los_angeles'; |
|
|
|
|
const query = builder.build({ |
|
|
|
|
refId: 'A', |
|
|
|
|
metrics: [{ type: 'count', id: '1' }], |
|
|
|
|
@ -916,7 +914,7 @@ describe('ElasticQueryBuilder', () => { |
|
|
|
|
type: 'date_histogram', |
|
|
|
|
id: '2', |
|
|
|
|
field: '@time', |
|
|
|
|
settings: { min_doc_count: '1', timeZone: expectedTimezone }, |
|
|
|
|
settings: { min_doc_count: '1' }, |
|
|
|
|
}, |
|
|
|
|
], |
|
|
|
|
}); |
|
|
|
|
|