Lint tests
parent
44e2a00448
commit
a82f1aa271
|
@ -10,7 +10,7 @@ import {
|
||||||
groupByTime,
|
groupByTime,
|
||||||
toggleTagAcceptance,
|
toggleTagAcceptance,
|
||||||
updateRawQuery,
|
updateRawQuery,
|
||||||
editRawQueryStatus,
|
editQueryStatus,
|
||||||
} from 'src/data_explorer/actions/view'
|
} from 'src/data_explorer/actions/view'
|
||||||
|
|
||||||
const fakeAddQueryAction = (panelID, queryID) => {
|
const fakeAddQueryAction = (panelID, queryID) => {
|
||||||
|
@ -112,7 +112,6 @@ describe('Chronograf.Reducers.queryConfig', () => {
|
||||||
|
|
||||||
describe('APPLY_FUNCS_TO_FIELD', () => {
|
describe('APPLY_FUNCS_TO_FIELD', () => {
|
||||||
it('applies functions to a field without any existing functions', () => {
|
it('applies functions to a field without any existing functions', () => {
|
||||||
const queryId = 123
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
[queryId]: {
|
[queryId]: {
|
||||||
id: 123,
|
id: 123,
|
||||||
|
@ -138,7 +137,6 @@ describe('Chronograf.Reducers.queryConfig', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('removes all functions and group by time when one field has no funcs applied', () => {
|
it('removes all functions and group by time when one field has no funcs applied', () => {
|
||||||
const queryId = 123
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
[queryId]: {
|
[queryId]: {
|
||||||
id: 123,
|
id: 123,
|
||||||
|
@ -172,7 +170,6 @@ describe('Chronograf.Reducers.queryConfig', () => {
|
||||||
|
|
||||||
describe('CHOOSE_TAG', () => {
|
describe('CHOOSE_TAG', () => {
|
||||||
it('adds a tag key/value to the query', () => {
|
it('adds a tag key/value to the query', () => {
|
||||||
const queryId = 123
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
[queryId]: buildInitialState(queryId, {
|
[queryId]: buildInitialState(queryId, {
|
||||||
tags: {
|
tags: {
|
||||||
|
@ -195,7 +192,6 @@ describe('Chronograf.Reducers.queryConfig', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('creates a new entry if it\'s the first key', () => {
|
it('creates a new entry if it\'s the first key', () => {
|
||||||
const queryId = 123
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
[queryId]: buildInitialState(queryId, {
|
[queryId]: buildInitialState(queryId, {
|
||||||
tags: {},
|
tags: {},
|
||||||
|
@ -214,7 +210,6 @@ describe('Chronograf.Reducers.queryConfig', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('removes a value that is already in the list', () => {
|
it('removes a value that is already in the list', () => {
|
||||||
const queryId = 123
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
[queryId]: buildInitialState(queryId, {
|
[queryId]: buildInitialState(queryId, {
|
||||||
tags: {
|
tags: {
|
||||||
|
@ -236,7 +231,6 @@ describe('Chronograf.Reducers.queryConfig', () => {
|
||||||
|
|
||||||
describe('GROUP_BY_TAG', () => {
|
describe('GROUP_BY_TAG', () => {
|
||||||
it('adds a tag key/value to the query', () => {
|
it('adds a tag key/value to the query', () => {
|
||||||
const queryId = 123
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
[queryId]: {
|
[queryId]: {
|
||||||
id: 123,
|
id: 123,
|
||||||
|
@ -258,7 +252,6 @@ describe('Chronograf.Reducers.queryConfig', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('removes a tag if the given tag key is already in the GROUP BY list', () => {
|
it('removes a tag if the given tag key is already in the GROUP BY list', () => {
|
||||||
const queryId = 123
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
[queryId]: {
|
[queryId]: {
|
||||||
id: 123,
|
id: 123,
|
||||||
|
@ -282,7 +275,6 @@ describe('Chronograf.Reducers.queryConfig', () => {
|
||||||
|
|
||||||
describe('TOGGLE_TAG_ACCEPTANCE', () => {
|
describe('TOGGLE_TAG_ACCEPTANCE', () => {
|
||||||
it('it toggles areTagsAccepted', () => {
|
it('it toggles areTagsAccepted', () => {
|
||||||
const queryId = 123
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
[queryId]: buildInitialState(queryId),
|
[queryId]: buildInitialState(queryId),
|
||||||
}
|
}
|
||||||
|
@ -296,7 +288,6 @@ describe('Chronograf.Reducers.queryConfig', () => {
|
||||||
|
|
||||||
describe('GROUP_BY_TIME', () => {
|
describe('GROUP_BY_TIME', () => {
|
||||||
it('applys the appropriate group by time', () => {
|
it('applys the appropriate group by time', () => {
|
||||||
const queryId = 123
|
|
||||||
const time = '100y'
|
const time = '100y'
|
||||||
const initialState = {
|
const initialState = {
|
||||||
[queryId]: buildInitialState(queryId),
|
[queryId]: buildInitialState(queryId),
|
||||||
|
@ -311,7 +302,6 @@ describe('Chronograf.Reducers.queryConfig', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('updates a query\'s raw text', () => {
|
it('updates a query\'s raw text', () => {
|
||||||
const queryId = 123
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
[queryId]: buildInitialState(queryId),
|
[queryId]: buildInitialState(queryId),
|
||||||
}
|
}
|
||||||
|
@ -324,16 +314,15 @@ describe('Chronograf.Reducers.queryConfig', () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it('updates a query\'s raw status', () => {
|
it('updates a query\'s raw status', () => {
|
||||||
const queryId = 123
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
[queryId]: buildInitialState(queryId),
|
[queryId]: buildInitialState(queryId),
|
||||||
}
|
}
|
||||||
const status = 'your query was sweet'
|
const status = 'your query was sweet'
|
||||||
const action = editRawQueryStatus(queryId, status)
|
const action = editQueryStatus(queryId, status)
|
||||||
|
|
||||||
const nextState = reducer(initialState, action)
|
const nextState = reducer(initialState, action)
|
||||||
|
|
||||||
expect(nextState[queryId].rawStatus).to.equal(status)
|
expect(nextState[queryId].status).to.equal(status)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue