From 563f42c4fdafc0804515a91f00051a2ad963f7b0 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Sat, 27 Mar 2021 15:29:26 +0100 Subject: [PATCH] fix tests --- .../apply_aggs_to_search_source.test.ts | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.test.ts b/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.test.ts index 29c93886ebba3..5d2be533065e7 100644 --- a/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.test.ts +++ b/src/plugins/discover/public/application/components/histogram/apply_aggs_to_search_source.test.ts @@ -24,45 +24,46 @@ describe('applyAggsToSearchSource', () => { const aggsConfig = applyAggsToSearchSource(true, searchSource, 'auto', indexPattern, dataMock); expect(aggsConfig!.aggs).toMatchInlineSnapshot(` - Array [ - Object { - "enabled": true, - "id": "1", - "params": Object {}, - "schema": "metric", - "type": "count", - }, - Object { - "enabled": true, - "id": "2", - "params": Object { - "drop_partials": false, - "extended_bounds": Object {}, - "field": "timestamp", - "interval": "auto", - "min_doc_count": 1, - "scaleMetricValues": false, - "useNormalizedEsInterval": true, + Array [ + Object { + "enabled": true, + "id": "1", + "params": Object {}, + "schema": "metric", + "type": "count", }, - "schema": "segment", - "type": "date_histogram", - }, - ] - `); + Object { + "enabled": true, + "id": "2", + "params": Object { + "drop_partials": false, + "extended_bounds": Object {}, + "field": "timestamp", + "interval": "auto", + "min_doc_count": 1, + "scaleMetricValues": false, + "useNormalizedEsInterval": true, + "used_interval": "0ms", + }, + "schema": "segment", + "type": "date_histogram", + }, + ] + `); expect(setField).toHaveBeenCalledWith('aggs', expect.any(Function)); const dslFn = setField.mock.calls[0][1]; expect(dslFn()).toMatchInlineSnapshot(` - Object { - "2": Object { - "date_histogram": Object { - "field": "timestamp", - "min_doc_count": 1, - "time_zone": "America/New_York", - }, - }, - } - `); + Object { + "2": Object { + "date_histogram": Object { + "field": "timestamp", + "min_doc_count": 1, + "time_zone": "America/New_York", + }, + }, + } + `); }); test('enabled = false', () => {