Make tests pass
parent
2b07507f1a
commit
5ca7265447
|
@ -341,13 +341,45 @@ describe('timeSeriesToTableGraph', () => {
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const actual = timeSeriesToTableGraph(influxResponse)
|
const qASTs = [
|
||||||
|
{
|
||||||
|
groupBy: {
|
||||||
|
time: {
|
||||||
|
interval: '2s',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupBy: {
|
||||||
|
time: {
|
||||||
|
interval: '2s',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupBy: {
|
||||||
|
time: {
|
||||||
|
interval: '2s',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupBy: {
|
||||||
|
time: {
|
||||||
|
interval: '2s',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
const actual = timeSeriesToTableGraph(influxResponse, qASTs)
|
||||||
const expected = [
|
const expected = [
|
||||||
['time', 'ma.f1', 'mb.f1', 'mc.f1', 'mc.f2'],
|
['time', 'ma.f1', 'mb.f1', 'mc.f1', 'mc.f2'],
|
||||||
[1000, 1, 1, null, null],
|
[1000, 1, 1, null, null],
|
||||||
[2000, 2, 2, 3, 3],
|
[2000, 2, 2, 3, 3],
|
||||||
[4000, null, null, 4, 4],
|
[4000, null, null, 4, 4],
|
||||||
]
|
]
|
||||||
|
|
||||||
expect(actual.data).toEqual(expected)
|
expect(actual.data).toEqual(expected)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -397,7 +429,38 @@ describe('timeSeriesToTableGraph', () => {
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
const actual = timeSeriesToTableGraph(influxResponse)
|
const qASTs = [
|
||||||
|
{
|
||||||
|
groupBy: {
|
||||||
|
time: {
|
||||||
|
interval: '2s',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupBy: {
|
||||||
|
time: {
|
||||||
|
interval: '2s',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupBy: {
|
||||||
|
time: {
|
||||||
|
interval: '2s',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
groupBy: {
|
||||||
|
time: {
|
||||||
|
interval: '2s',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
const actual = timeSeriesToTableGraph(influxResponse, qASTs)
|
||||||
const expected = ['time', 'ma.f1', 'mb.f1', 'mc.f1', 'mc.f2']
|
const expected = ['time', 'ma.f1', 'mb.f1', 'mc.f1', 'mc.f2']
|
||||||
|
|
||||||
expect(actual.data[0]).toEqual(expected)
|
expect(actual.data[0]).toEqual(expected)
|
||||||
|
@ -406,7 +469,9 @@ describe('timeSeriesToTableGraph', () => {
|
||||||
it('returns an array of an empty array if there is an empty response', () => {
|
it('returns an array of an empty array if there is an empty response', () => {
|
||||||
const influxResponse = []
|
const influxResponse = []
|
||||||
|
|
||||||
const actual = timeSeriesToTableGraph(influxResponse)
|
const qASTs = []
|
||||||
|
|
||||||
|
const actual = timeSeriesToTableGraph(influxResponse, qASTs)
|
||||||
const expected = [[]]
|
const expected = [[]]
|
||||||
|
|
||||||
expect(actual.data).toEqual(expected)
|
expect(actual.data).toEqual(expected)
|
||||||
|
|
Loading…
Reference in New Issue