From 97ef8a52b59b6e5ae3a9360284ffb86ccee20141 Mon Sep 17 00:00:00 2001 From: Jared Scheib <jared.scheib@gmail.com> Date: Thu, 7 Sep 2017 12:50:50 -0700 Subject: [PATCH] Test client DE fill for ints and floats --- .../data_explorer/reducers/queryConfigSpec.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/ui/spec/data_explorer/reducers/queryConfigSpec.js b/ui/spec/data_explorer/reducers/queryConfigSpec.js index ee86e1752..a2a9d7e1c 100644 --- a/ui/spec/data_explorer/reducers/queryConfigSpec.js +++ b/ui/spec/data_explorer/reducers/queryConfigSpec.js @@ -418,5 +418,29 @@ describe('Chronograf.Reducers.DataExplorer.queryConfigs', () => { expect(nextState[queryId].fill).to.equal(LINEAR) }) + + it('updates fill to string integer value', () => { + const initialState = { + [queryId]: buildInitialState(queryId), + } + const INT_STRING = '1337' + const action = fill(queryId, INT_STRING) + + const nextState = reducer(initialState, action) + + expect(nextState[queryId].fill).to.equal(INT_STRING) + }) + + it('updates fill to string float value', () => { + const initialState = { + [queryId]: buildInitialState(queryId), + } + const FLOAT_STRING = '1.337' + const action = fill(queryId, FLOAT_STRING) + + const nextState = reducer(initialState, action) + + expect(nextState[queryId].fill).to.equal(FLOAT_STRING) + }) }) })