fix test for query generation

This commit is contained in:
Sven Klemm 2018-07-15 22:58:25 +02:00
parent 7f348f3836
commit 0e608a08c2
2 changed files with 2 additions and 1 deletions

View File

@ -17,7 +17,7 @@ export default class PostgresQuery {
target.metricColumn = target.metricColumn || 'none';
target.groupBy = target.groupBy || [];
target.where = target.where || [{ type: 'macro', params: ['$__timeFilter'] }];
target.where = target.where || [{ type: 'macro', name: '$__timeFilter', params: [] }];
target.select = target.select || [[{ type: 'column', params: ['value'] }]];
// handle pre query gui panels gracefully

View File

@ -98,6 +98,7 @@ describe('PostgresQuery', function() {
schema: 'public',
table: 'table',
select: [[{ type: 'column', params: ['value'] }]],
where: [],
};
let result = 'SELECT\n t AS "time",\n value\nFROM public.table\nORDER BY 1';
let query = new PostgresQuery(target, templateSrv);