Browse Source

upd SQL test

pull/12/head
rozetko 2 years ago
parent
commit
6bf90e69bb
  1. 48
      spec/sql.jest.ts

48
spec/sql.jest.ts

@ -37,22 +37,40 @@ describe('Test result parsing', function() {
data: {
results: {
A: {
refId: 'A',
meta: {
rowCount:0,
sql: 'SELECT "time" AS "time", val FROM local ORDER BY 1'
},
series: [
frames: [
{
name:"val",
points: [
[622, timestamps[0]],
[844, timestamps[1]],
[648, timestamps[2]]
]
schema: {
refId: 'A',
meta: {
'executedQueryString': 'SELECT\n \"time\" AS \"time\",\n eur\nFROM rate_test\nWHERE\n \"time\" >= 1669648679 AND \"time\" <= 1672240679\nORDER BY 1'
},
fields: [
{
name: 'Time',
type: 'time',
typeInfo: {
frame: 'time.Time',
nullable: true
}
},
{
name: 'eur',
type: 'number',
typeInfo: {
frame: 'float64',
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);
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);
});
});

Loading…
Cancel
Save