diff --git a/ui/spec/data_explorer/reducers/queryConfigSpec.js b/ui/spec/data_explorer/reducers/queryConfigSpec.js index 379f4814a1..badd1224fd 100644 --- a/ui/spec/data_explorer/reducers/queryConfigSpec.js +++ b/ui/spec/data_explorer/reducers/queryConfigSpec.js @@ -22,7 +22,7 @@ const fakeAddQueryAction = (panelID, queryID) => { } function buildInitialState(queryId, params) { - return Object.assign({}, defaultQueryConfig(queryId), params) + return Object.assign({}, defaultQueryConfig({id: queryId}), params) } describe('Chronograf.Reducers.DataExplorer.queryConfigs', () => { @@ -32,7 +32,7 @@ describe('Chronograf.Reducers.DataExplorer.queryConfigs', () => { const state = reducer({}, fakeAddQueryAction('blah', queryId)) const actual = state[queryId] - const expected = defaultQueryConfig(queryId) + const expected = defaultQueryConfig({id: queryId}) expect(actual).to.deep.equal(expected) }) @@ -360,7 +360,7 @@ describe('Chronograf.Reducers.DataExplorer.queryConfigs', () => { const initialState = { [queryId]: buildInitialState(queryId), } - const expected = defaultQueryConfig(queryId, {rawText: 'hello'}) + const expected = defaultQueryConfig({id: queryId}, {rawText: 'hello'}) const action = updateQueryConfig(expected) const nextState = reducer(initialState, action) diff --git a/ui/spec/data_explorer/utils/influxql/selectSpec.js b/ui/spec/data_explorer/utils/influxql/selectSpec.js index f828db90ba..a5f77d264c 100644 --- a/ui/spec/data_explorer/utils/influxql/selectSpec.js +++ b/ui/spec/data_explorer/utils/influxql/selectSpec.js @@ -1,6 +1,8 @@ import buildInfluxQLQuery from 'utils/influxql' import defaultQueryConfig from 'src/utils/defaultQueryConfig' +import {NULL_STRING} from 'shared/constants/queryFillOptions' + function mergeConfig(options) { return Object.assign({}, defaultQueryConfig(123), options) } @@ -87,13 +89,14 @@ describe('buildInfluxQLQuery', () => { retentionPolicy: 'rp1', fields: [{field: 'value', funcs: ['min']}], groupBy: {time: '10m', tags: []}, + fill: NULL_STRING, }) timeBounds = {lower: 'now() - 12h'} }) it('builds the right query', () => { const expected = - 'SELECT min("value") AS "min_value" FROM "db1"."rp1"."m0" WHERE time > now() - 12h GROUP BY time(10m)' + 'SELECT min("value") AS "min_value" FROM "db1"."rp1"."m0" WHERE time > now() - 12h GROUP BY time(10m) FILL(null)' expect(buildInfluxQLQuery(timeBounds, config)).to.equal(expected) }) }) @@ -145,13 +148,14 @@ describe('buildInfluxQLQuery', () => { measurement: 'm0', fields: [{field: 'value', funcs: ['min']}], groupBy: {time: '10m', tags: ['t1', 't2']}, + fill: NULL_STRING, }) timeBounds = {lower: 'now() - 12h'} }) it('builds the right query', () => { const expected = - 'SELECT min("value") AS "min_value" FROM "db1"."rp1"."m0" WHERE time > now() - 12h GROUP BY time(10m), "t1", "t2"' + 'SELECT min("value") AS "min_value" FROM "db1"."rp1"."m0" WHERE time > now() - 12h GROUP BY time(10m), "t1", "t2" FILL(null)' expect(buildInfluxQLQuery(timeBounds, config)).to.equal(expected) }) }) diff --git a/ui/spec/kapacitor/reducers/queryConfigSpec.js b/ui/spec/kapacitor/reducers/queryConfigSpec.js index 7232df6453..3d638622c7 100644 --- a/ui/spec/kapacitor/reducers/queryConfigSpec.js +++ b/ui/spec/kapacitor/reducers/queryConfigSpec.js @@ -19,7 +19,11 @@ const fakeAddQueryAction = (panelID, queryID) => { } function buildInitialState(queryId, params) { - return Object.assign({}, defaultQueryConfig(queryId), params) + return Object.assign( + {}, + defaultQueryConfig({id: queryId, isKapacitorRule: true}), + params + ) } describe('Chronograf.Reducers.Kapacitor.queryConfigs', () => { @@ -29,7 +33,7 @@ describe('Chronograf.Reducers.Kapacitor.queryConfigs', () => { const state = reducer({}, fakeAddQueryAction('blah', queryId)) const actual = state[queryId] - const expected = defaultQueryConfig(queryId) + const expected = defaultQueryConfig({id: queryId, isKapacitorRule: true}) expect(actual).to.deep.equal(expected) })