|
|
@ -37,22 +37,40 @@ describe('Test result parsing', function() { |
|
|
|
data: { |
|
|
|
data: { |
|
|
|
results: { |
|
|
|
results: { |
|
|
|
A: { |
|
|
|
A: { |
|
|
|
|
|
|
|
frames: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
schema: { |
|
|
|
refId: 'A', |
|
|
|
refId: 'A', |
|
|
|
meta: { |
|
|
|
meta: { |
|
|
|
rowCount:0, |
|
|
|
'executedQueryString': 'SELECT\n \"time\" AS \"time\",\n eur\nFROM rate_test\nWHERE\n \"time\" >= 1669648679 AND \"time\" <= 1672240679\nORDER BY 1' |
|
|
|
sql: 'SELECT "time" AS "time", val FROM local ORDER BY 1' |
|
|
|
}, |
|
|
|
|
|
|
|
fields: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
name: 'Time', |
|
|
|
|
|
|
|
type: 'time', |
|
|
|
|
|
|
|
typeInfo: { |
|
|
|
|
|
|
|
frame: 'time.Time', |
|
|
|
|
|
|
|
nullable: true |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
series: [ |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
name:"val", |
|
|
|
name: 'eur', |
|
|
|
points: [ |
|
|
|
type: 'number', |
|
|
|
[622, timestamps[0]], |
|
|
|
typeInfo: { |
|
|
|
[844, timestamps[1]], |
|
|
|
frame: 'float64', |
|
|
|
[648, timestamps[2]] |
|
|
|
nullable: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
data: { |
|
|
|
|
|
|
|
values: [ |
|
|
|
|
|
|
|
[ timestamps[0], timestamps[1], timestamps[2] ], |
|
|
|
|
|
|
|
[ 1.53, 1.17, 1.17 ], |
|
|
|
] |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
} |
|
|
|
tables: 'null' |
|
|
|
] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -61,7 +79,7 @@ describe('Test result parsing', function() { |
|
|
|
let result = connector.parseResponse(response); |
|
|
|
let result = connector.parseResponse(response); |
|
|
|
|
|
|
|
|
|
|
|
it('check results columns order', function() { |
|
|
|
it('check results columns order', function() { |
|
|
|
let timestampColumnNumber = result.columns.indexOf('timestamp'); |
|
|
|
let timestampColumnNumber = result.columns.indexOf('Time'); |
|
|
|
expect(result.values.map(v => v[timestampColumnNumber])).toEqual(timestamps); |
|
|
|
expect(result.values.map(v => v[timestampColumnNumber])).toEqual(timestamps); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|